Jump to content

Widgets in ObjectGui won't get focused when mouse clicks


photo

Recommended Posts

“won't get focused” refers that if I click on an editable widget, it won’t allow me to type something into the box, but enters the player’s camera navigation mode.

 

This happens when there are more than one ObjectGui under the click position, or the mouse ray is intersecting multiple objects(they do not have to be coincidence). If this happens, no ObjectGui will enter FOCUS_IN event. How can I solve that?

 

I’m using ObjectGui instead of ObjectBillboard, since labels, images, editable widgets can be easily placed on, and the users can interact with the it freely.

Link to comment

Steps:
1.    Establish a new unigine project from unigine browser.
2.    Replace source/AppWorldLogic.cpp with the uploaded file.
3.    Copy cat.png into the data folder.
4.    Compile and run, you would see a big block of billboards (ObjectGui with billboard option).
5.    Fly to some middle point of the billboards. Press ESC to escape flying.
6.    Click on the Edit Widget on certain billboard.

You may notice that there is a great chance the widget won’t get focused.

twoFiles.zip

Link to comment
Can you reproduce this problem?

 

Another thing: ObjectBillboard renders very fast while ObjectGui renders much slower: 1000 ObjectGuis with several widgets inside would cause serious performance problem. Is this normal?

Link to comment

Hi liu.yan,

Thank you for the reproduction details.
We can confirm the behavior you've described.

There's two problems with the ObjectGui we've found.

First is the incompatibility between Billboard and Background flags.
As you can see the background doesn't behave like a billboard and keeps initial orientation.

And the second is a wrong sorting of billboards during the render.
In the heavy clutter of ObjectGui as in your sample sometimes the billboard that renders as foremost is not actually closest to the camera.
The mouse clicks in this case are still projected correctly and are actually handled by another ObjectGui.
This is easier to observe when MouseShow is enabled for all ObjectGui nodes.

In your sample this is also aggravated by the fact that canvas size of ObjectGui is larger than the background picture.
It can be changed using the setScreenSize() method.

I've posted an issue for both of the found bugs.
However I'm afraid we don't know any temporary workarounds and I hope you can wait until it'll be fixed in future releases.

Regarding your latest question, ObjectGui is inherently slower than simple billboards.
This is because there is extra computation relating to the GUI management has to be done every frame.
While ObjectBillboards has to update billboards orientation and render them and that's all.

Link to comment
  • 10 months later...

Hi, ded. Is this problem solved ? This function  is very important for our applications since it provided with real-time user interaction. So~I'm asking you again.

Link to comment
×
×
  • Create New...