Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curved item renderers and layouts #49

Open
ilanb opened this issue Nov 15, 2016 · 3 comments
Open

Curved item renderers and layouts #49

ilanb opened this issue Nov 15, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@ilanb
Copy link

ilanb commented Nov 15, 2016

Hi zachkinstner,

Is not a issues or bugs, I use extensivly in my VR project this plugin: https://www.assetstore.unity3d.com/en/#!/content/53258 CurvedUI with UGUI elements.
Do you think is a possible to make same possibility with your kit ?

Bests,

@zachkinstner zachkinstner self-assigned this Nov 15, 2016
@zachkinstner
Copy link
Member

Hi @ilanb, it should be possible to do this, but it would require custom work on your side. Item renderers can be any shape, including 3D shapes, but currently the system only provides built-in support for "Rect" and "Arc" shapes.

I have previously implemented a prototype UI system where the panels are curved to fit on the surface of a sphere. So, shapes that fit on a sphere or cylinder are both on my longer-term to-do list for Hover UI Kit. Until then, if you do decide to implement your own, I can point you to some docs and code that should help you get started.

If you're asking about the combination of this plugin with Hover UI Kit, I don't know whether that will work. Hover UI Kit uses more than just a canvas (the shapes are built with custom meshes) so I doubt they would be compatible.

@ilanb
Copy link
Author

ilanb commented Nov 15, 2016

Thanks for quick reply, yes I'm interested to help me with some doc and code to try to implement myself.
For last part (CurvedUI) I'm not interested by a combination, I think too, there is not compatible with your kit (meshes generator).
Great news that are on your longer term todo :-)

@zachkinstner zachkinstner changed the title Curved layout ? Curved item renderers and layouts Nov 16, 2016
@zachkinstner
Copy link
Member

@ilanb, this will be a complex task. There are a several things to do, which fall into the following groups:

  1. Create a new "shape" type (as an addition to the "Arc" and "Rect" shapes already provided) that supports curved geometry. The shape controls the size, arc, and other geometric values for use by the item renderer. This step would include writing code to generate the curved meshes, to update the various elements using the shape's properties, etc.
  2. Create "canvas elements" for item renderers (like labels and icons) that can support curvature. I'm not sure exactly how I would approach this, perhaps the plugin that you mentioned would help.
  3. Create item renderer prefabs that include the new curved shape, the meshes/geometry, and the curved canvas elements. These prefabs can be provided to an item, which would cause the item to use your new curved item renderer.
  4. Optionally: Implement a "curved shape" layout that can arrange these items automatically. Otherwise, it would be fine to size/position them manually.

This would be a very long tutorial, and hard to generalize. It would probably be faster for me to implement the feature, rather than try to document all the steps :)

Reading through the wiki pages, especially the Renderers page, would be a good start. The "shape" code is located here.

@zachkinstner zachkinstner added this to the Medium-Term milestone Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants