Forum Discussion
virror
12 years agoExplorer
NGUI rendertexture input issues
I use NGUI for all my GUI work and i thought i convert it to a plane using rendertexture so i can get it right with the Rift. This was really easy and i now have the GUI on a simple quad, the issue however is with the input. I cant get it to trigger on the correct place, now i have to move the cursor way over the buttons for them to trigger instead of pressing ontop of the actual button as it should be. Anyone know a solution to this?
7 Replies
Replies have been turned off for this discussion
- sh0v0rProtege
"virror" wrote:
I use NGUI for all my GUI work and i thought i convert it to a plane using rendertexture so i can get it right with the Rift. This was really easy and i now have the GUI on a simple quad, the issue however is with the input. I cant get it to trigger on the correct place, now i have to move the cursor way over the buttons for them to trigger instead of pressing ontop of the actual button as it should be. Anyone know a solution to this?
I require the use of either keyboard or a gamepad to navigate menus in Lunar Flight.
Ideally you would use the head trackers orientation and cast a ray from the NGUI Cameras position to trigger touch inputs, but mapping this into a 1:1 space would be tricky. Because of the difference in scale and distance between the UICamera and the OVRCameraController relative to the Quad. - virrorExplorerI can trigger the buttons no problem, but the scale seems wrong. Looks like many are using rendertexture for their GUI, so must be a decently easy solution for this?
- boone188Honored Guest
"virror" wrote:
I can trigger the buttons no problem, but the scale seems wrong. Looks like many are using rendertexture for their GUI, so must be a decently easy solution for this?
I have never used NGUI, but if you can share your code I might be able to help. - virrorExplorerYour response got me thinking in a different way, and i think i found the theory to solve the issue : p
Pretty easy actually, using the main camera to calculate the NGUI raycasts instead of the NGUI camera should give the correct results i think, now i just need to figure out how to do that : ) - virrorExplorerI solved the input issue by doing some scaling inside the UICamera script, dont have the code here but will post i later.
The problem now is that the whole quad is visible on the screen, how do i get rid of the parts that are not the GUI? I guess i want everything thats not GUI to be transparent, but could not get that to work : / - boone188Honored Guest
"virror" wrote:
I solved the input issue by doing some scaling inside the UICamera script, dont have the code here but will post i later.
The problem now is that the whole quad is visible on the screen, how do i get rid of the parts that are not the GUI? I guess i want everything thats not GUI to be transparent, but could not get that to work : /
What material are you using for the surface? You can use the menu material from the OVR package and that should do what you want. - bullardoHonored GuestHas anyone figured out how to deal with the UI scale properly? My buttons are way off.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 months ago
- 2 years ago
- 2 months ago
- 2 years ago
- 2 months ago