Giter Site home page Giter Site logo

Comments (5)

zachkinstner avatar zachkinstner commented on May 11, 2024 1

@ahsquared, the v2.0.0A (alpha) release is now available. In v2.0, it is much easier to customize items, and you can do so without any custom code. Each item's entire "renderer" structure is present (and visible) in the editor, and most properties are adjustable. For now, there is just one default renderer type for items (from the "Alpha" renderer module), but anyone can create more (possibly without much/any custom code).

I made a new Customize Items wiki page today. I hope to add more examples there soon, but for now it contains instructions (and corresponding animation) for changing the materials within an item renderer:

Customize Item Material

from hover-ui-kit.

zachkinstner avatar zachkinstner commented on May 11, 2024

It's possible, but it will require writing a custom renderer. Eventually, it would be a good feature to add support this kind of thing (and other settings/options) within the "standard" renderers.

For Hovercast, the code for the standard renderers is here and the code for the renderer's visual settings is here. Custom renderers are an advanced topic, and I haven't had a chance to write documentation for this process. If you do give it a try, we can use this topic for Q&A.

from hover-ui-kit.

ahsquared avatar ahsquared commented on May 11, 2024

Finally got some time to look into this:

I'm not sure if this is the right way to do this, but it felt like the simplest way to add an image background to the hover cast renderers. I applied it to UISelectItemRenderer. I wasn't sure about adding it globally or adding it to each renderer so just started with this one.
There is an updateBackgroundImage method where I change the main Texture and shader, and had to change the translation slightly as I was getting weird artifacts from the text and highlights. I'm sure there is a better way to do this...

    public virtual void UpdateBackgroundImage(Texture pTexture) {
            if (pTexture != BackgroundImage && pTexture != null)
            {
                Background.GetComponent<MeshRenderer>().material.mainTexture = pTexture;
                Background.GetComponent<MeshRenderer>().material.shader = Shader.Find("SelfIllumAlpha"); // better way??
                Background.transform.Translate(0, 0.001F, 0); // better way??
            }

            BackgroundImage = pTexture;
        }

These are the files with changes:
Core/Solution/Hover.Cast/Custom/Standard/HovercastItemVisualSettingsStandard.cs
Core/Solution/Hover.Cast/Custom/Standard/ItemVisualSettingsStandard.cs
Core/Solution/Hover.Cast/Display/Standard/UiItemSelectRenderer.cs
Core/Solution/Hover.Common/Display/UiHoverMesh.cs

You can see my changes here: ahsquared@65e10f2

Thoughts?

from hover-ui-kit.

zachkinstner avatar zachkinstner commented on May 11, 2024

Hi @ahsquared, sorry for the long delay. My consulting work has been keeping me very busy, and I've fallen behind on my own projects.

I have not had a chance to review this work, but thank you very much for posting it. Over a few days in January, I have started the process of revising the way items are structured and configured in Unity. If you're curious, this is happening in the items branch. As part of this work (which I expect will be v2.0, and not backwards compatible) I plan to improve the way developers can modify the look of the items, including support for materials.

from hover-ui-kit.

zachkinstner avatar zachkinstner commented on May 11, 2024

I'm going to close this ticket for now, but we can re-open it if needed.

from hover-ui-kit.

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.