Another quastion about GUI (SOLVED)

Hello, guys. Is there any method to visual synchronize gui’s coordinates and go’s coordinates? I want to attach gui element to go so i need it to look like hp bar or something like that. In my case they got same coordinates but different positions (on the screen).

For healthbar attached to characters I would use GO directly.

1 Like

Yup, I would probably also do it as a game object. The nine-slicing in box nodes in the gui is quite nifty though.

Yea, i know, but for me shape of node is very important. Can i do something like that with go?

Ok, so you want a pie-node of varying shape to follow a game object? In that case I guess it’s best to do it with the gui. If you select the root of a gui scene you have a field in the properties window called Adjust Mode. If you set that to Disabled you will be able to position the gui in such a way that it follows how you draw your game objects using a custom render script. I used to have an example of how to let text nodes follow game objects, but I removed that example when we introduced the label component. The code can be seen here:

I could bring back the example and adjust it to what it is you wish to do, but I think you’ll be able to follow along by looking at the code on GitHub?

will try, thank you!

Shame,I’m stipid :tired_face: can u do that please?

I could bring back the example and adjust it to what it is you wish to do

I’ve recreated my example here:

SOURCE: https://github.com/britzl/publicexamples/tree/master/examples/gui_follows_go
HTML5: http://britzl.github.io/publicexamples/gui_follows_go/index.html

3 Likes

Thank you!