Comments (5)
@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:
from hover-ui-kit.
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.
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.
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.
I'm going to close this ticket for now, but we can re-open it if needed.
from hover-ui-kit.
Related Issues (20)
- How do I add event listeners to an item? HOT 1
- Radio Buttons on the Fly HOT 3
- I can't get started HOT 2
- How to attach the UI to gesture HOT 4
- Question about HoverInputSceneLoader HOT 1
- fail to update value from HoverItemDataSlider HOT 2
- Raycast on Finger HOT 2
- Trying example scenes with Vive HOT 2
- The type or namespace name `UnityStandardAssets' could not be found. Are you missing an assembly reference? HOT 2
- Interaction with Unity UI HOT 1
- TreeUpdate is Glitching Out when using a slider HOT 4
- Multiple Depricated Dependencies HOT 22
- Registering hovercast events HOT 2
- Hololens input HOT 1
- How to use OVR Grabber with the module? HOT 1
- "Hover Layout Arc" doesn't spread child GameObjects but keeps them piled on top of each other HOT 2
- Sprite swap by hovering HOT 3
- Add support for Oculus Hand Tracking *Feature request*
- Support for Unity's XR Interaction Toolkit? HOT 1
- error CS0234: The type or namespace name 'ImageEffects' does not exist in the namespace
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hover-ui-kit.