Welcome,
Guest
. Please
login
or
register
.
June 04, 2023, 07:22:01 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How to set anchors through code?
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to set anchors through code? (Read 1231 times)
whilesocold
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 2
How to set anchors through code?
«
on:
July 19, 2015, 06:11:02 AM »
Hi, can you help me to get coords for setting anchor through code, like on attached image?
Best regards.
«
Last Edit: July 19, 2015, 12:22:57 PM by whilesocold
»
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: How to set anchors through code?
«
Reply #1 on:
July 21, 2015, 11:32:08 AM »
For example:
widget.topAnchor.Set(1f, -162f);
...where "1f" means "top" in this case (0f would be bottom, 0.5f would be center, etc).
So the code above effectively means "take the target's top and subtract 162 to get the top anchor's position".
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How to set anchors through code?