Welcome,
Guest
. Please
login
or
register
.
January 23, 2025, 03:19:11 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Set Anchor to current position in script
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set Anchor to current position in script (Read 1579 times)
abrk
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 3
Set Anchor to current position in script
«
on:
September 13, 2016, 11:43:25 AM »
Hi
I know there are similar topics but i couldn't find my answer
In UIWidget anchors there's a "Set to current Position" option.
I have a lot of widgets in my scene and want to write a editor script to anchor all of them to "Set to current position" mode.
How should i do this by code?
Thanks in advance
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Set Anchor to current position in script
«
Reply #1 on:
September 13, 2016, 12:03:48 PM »
Search for "Set to Current", arrive on line 316 of UIRectEditor.cs. The math is right there. It gets the sides, sets the anchor's relative value based on it and removes the absolute part. You can do something similar in your script.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Set Anchor to current position in script