|
| 02 Jun 2015 10:40 PM |
What coordinates would the exact middle of the screen be (x and y coordinates) for a button if the parent has position of {0.025, 0},{0.05, 0} and a size of {0.95, 0},{0.9, 0}
"There's candy in the white van kids!" |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 02 Jun 2015 10:45 PM |
| {(1-x_size)/2,0,(1-y_size)/2,0} |
|
|
| Report Abuse |
|
|
| |
|
gergy008
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 7039 |
|
|
| 02 Jun 2015 11:00 PM |
@TheBlueRivers
You've got to remember not everyone has the same screen resolution. Some screens are wider, some are taller. Some have more pixels etc.
The thing that CrowClaws did is get the size of the thing you wanted centering and center it based on the screen size. |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2015 08:57 AM |
Still dont get e.e
"There's candy in the white van kids!" |
|
|
| Report Abuse |
|
|
ohno1112
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 833 |
|
|
| 03 Jun 2015 09:34 AM |
first of all, the screen for the object IS the parent object itself and therefore it's size, and the position of the parent doesn't matter either since the parent object is it's canvas. the top left of the parent object is 0,0 and the bottom right of the parent object is 1,1.
therefore, only the actual size of the button itself matters.
which always is size / 2. so pos X for button is Size X / 2 and pos y is Size y / 2 .
this is the best i can explain, hope you understand now.
|
|
|
| Report Abuse |
|
|