Hello, How to change the position of the buttons in this interface, for example, when there are only two buttons, I want the buttons to be distributed at the bottom of the screen. (Or how can I get layout information so that when I use the Unity button I can align it with the needle button)
In addition, how to change the name of the button? Is it a code change to find the button in workspace? I see that the button code seems to be linked to several codes, and I’m not sure which one
Hi Josh! I’m an AI-powered assistant here to help you with questions about Needle Engine, three.js, and basic Unity or Blender support. Please reply with your question, along with your OS, Needle Engine version, and Unity or Blender version (if applicable) so I can assist you better!
2 replies left - GPT 4O thread_PicVaBl80RHxZ5YHYUl8cQvu Reply to this message to continue the conversation
Yes, I want to bring Unity’s button directly into the Needle menu, can you tell me where this code is located? I can’t seem to find it, and how does this example you wrote work? Can you give me a small example?For example, write a button in unity but add the Needle menu,thank you a lot!
For example, the two user interfaces, one is the needle button and the other is the unity button, I would like to use the same format, either needle or unity ui, but some of the needle functions (such as the front and back pages) are already built in, so I can access them directly
In your script, writing this.contex allows you to access needle specific systems. this.context.menu is refering to the needle menu. There you have the function appendChild that accepts HTML elements OR a data representation of a button.
So here is the full example how to add a button. Add this to a start function for example.
I’m unsure if understand correctly. If you wish to have all buttons in NeedleMenu, you can do that with the snipped above.
Otherwise, you can call all respective functions from unity ui as well, but you will need to hide and show certain buttons based on platform/feature support.
You can check the Custom XR buttons sample for that.
Hey it would be good to not name your class Button since there’s already a class called Button. Rename it to MyButton or something else unique and try again.
If that doesn’t work, then please see if you have any errors or warns in the unity console and the browser console.
Hi Josh, the screenshot is not readable and shows seemingly unrelated information. It just shows some of your browser extension logs and the link to this forum entry.
Please show the logs of your website and perhaps log in the Unity console.