Welcome,
Guest
. Please
login
or
register
.
December 06, 2024, 02:23:20 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Constrain to UI Panel
« previous
next »
Print
Pages: [
1
]
Author
Topic: Constrain to UI Panel (Read 2739 times)
Littlenorwegians
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 2
Constrain to UI Panel
«
on:
September 27, 2017, 03:10:52 PM »
Hello!
Trying to work my way around an issue. Basically what I am trying to do is ensure that a UIlabel here always stays within the borders of the UI Root's panel.
https://www.dropbox.com/s/o28oj3nq01lo7nz/WithinBorders.mp4?raw=1
(This video showcases the problem quite exactly)
I've fiddled around but I can't really find the "right words" in NGUI to confine this UI element within the bounds.
Very grateful for the help
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Constrain to UI Panel
«
Reply #1 on:
October 07, 2017, 06:13:00 AM »
All the math you need is in the UIDragObject script. Look for "restrictWithinPanel" and how it uses panel.ConstrainTargetToBounds.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Constrain to UI Panel