I have a node with anchor(top left)(profile)
Also i have another node(border) that i whant to draw on that node with anchor
How can i get that gui position?
Thanks.
Hack it with set_parent and keep_transform false
if(parent) then
pos = pos - gui.get_screen_position(parent)
gui.set_position(self.vh.root, pos)
gui.set_parent(self.vh.root,parent,false)
else
gui.set_parent(self.vh.root,nil,false)
gui.set_position(self.vh.root, pos)
end
But question is actual
I’m not entirely sure I understand the problem. Is the border a child node of the portrait?
No border is another node.With no parent.
(i set profile btn node as parent for border node, because i can’t get position with anchors)
I have 2 nodes.
1)Profile btn (anchor to Top Left)
2)Border (no anchor)
When screen size is same as in game.project(screen 1) all ok
But when width is bigger then default. Profile btn moved to left side,because of anchor.(screen 2)
gui.get_screen_position(parent)
will return same position in all cases.
I need to get position for border, so it looks same as in (screen1)
I am looking for some method like gui.get_screen_position(node) but that know about anchors.