Welcome,
Guest
. Please
login
or
register
.
April 26, 2026, 08:09:46 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How to restrict a UIWidget's minimum size?
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to restrict a UIWidget's minimum size? (Read 6214 times)
leagueofmonkeys
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 20
How to restrict a UIWidget's minimum size?
«
on:
October 22, 2015, 05:28:48 PM »
Hi, I have a UIWidget anchored to a UILabel and I would like the UIWidget to never go below a minimum height or width. How can I acheive this?
Thanks
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: How to restrict a UIWidget's minimum size?
«
Reply #1 on:
October 24, 2015, 04:39:08 AM »
using
UnityEngine
;
public
class
MyCustomWidget
:
UIWidget
{
/// <summary>
/// Minimum allowed width for this widget.
/// </summary>
override
public
int
minWidth
{
get
{
return
200
;
}
}
/// <summary>
/// Minimum allowed height for this widget.
/// </summary>
override
public
int
minHeight
{
get
{
return
200
;
}
}
}
...overwrite "200" with whatever value you need.
Logged
leagueofmonkeys
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 20
Re: How to restrict a UIWidget's minimum size?
«
Reply #2 on:
October 25, 2015, 05:23:53 PM »
Thanks ArenMook
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How to restrict a UIWidget's minimum size?