Giter Site home page Giter Site logo

UIButton:How to change the background color of a button to an custom image, and how to change the window background to transparent? about stereokit HOT 1 CLOSED

jike2018 avatar jike2018 commented on May 28, 2024
UIButton:How to change the background color of a button to an custom image, and how to change the window background to transparent?

from stereokit.

Comments (1)

maluoi avatar maluoi commented on May 28, 2024

To make a window "transparent", you can either use UI.WindowBegin/End with UIWin.Head or UIWin.Empty, or skip the window and use UI.Push/PopSurface.

Making a button background use an image is more work. I'd probably recommend avoiding it unless it's critical? You basically need to texture the button in order to do it, which gets into some technical art work. If it's something where you have no choice in the matter, or you're comfortable with that sort of work, I'd peek here at an "Edge decoration" sample I put together. This sample is more targeted towards solid colors, but totally works with images as well.

You may also be interested in creating your own custom buttons as well. If you use UI.ButtonBehavior, you can get all of SK's button behavior, but without any of the rendering. This lets you render whatever you'd like instead of what SK provides.

from stereokit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.