Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.

Screen relative position/size broken #43

Open
GoogleCodeExporter opened this issue Jul 17, 2015 · 3 comments
Open

Screen relative position/size broken #43

GoogleCodeExporter opened this issue Jul 17, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I wanted to change ChatBox at the top of the screen. Originally I had it like

pos = 10,10
size = 1000,400

The, I wanted to try relative sizes

pos = 0.01f, 0.01f
size = 0.98f, 400

It turns out that it doesn't work - I need to call validateLayout for it to 
take effect. Ok, validateLayout - but surprise, y position percentage is 
counted from the bottom, not from the top as all other coordinates. Ok, correct 
it to

pos = 0.01f, 0.99f
size = 0.98f, 400

And again suprise - it is bottom side of the chatbox which is placed at 0.99f, 
not top one.

Ok, correct it to
pos = 0.01f, 0.80f
size = 0.98f,0.19f

and now it is positioned correctly, but contents are destroyed...

Original issue reported on code.google.com by [email protected] on 25 Mar 2013 at 7:24

@GoogleCodeExporter
Copy link
Author

Seems that validateLayout is messing up the position to bottom of the screen 
regardless if it is percentage or absolute.

Original comment by [email protected] on 25 Mar 2013 at 7:26

@GoogleCodeExporter
Copy link
Author

This method of adding relative positioned elements never worked out correctly.  
The best way of handling this is parent.getWidth()*0.9f, 
parent.getWidth()*0.5f, etc.

Eventually I'll revisit this approach and see if I can get it working.

Original comment by [email protected] on 6 Apr 2013 at 5:06

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 6 Apr 2013 at 5:06

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant