Welcome,
Guest
. Please
login
or
register
.
April 19, 2026, 06:36:50 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
bug in UIInput
« previous
next »
Print
Pages: [
1
]
Author
Topic: bug in UIInput (Read 8502 times)
jmclaren
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 7
bug in UIInput
«
on:
February 19, 2013, 10:38:44 AM »
When you type more characters into a Input widget than the lineWidth of the child UILabel with single line, centre pivot, the whole UILabel teleports off to the right. observed in 2.3.1 and 2.3.3h
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: bug in UIInput
«
Reply #1 on:
February 19, 2013, 08:53:22 PM »
That's because only left-aligned input fields are supported. This is enforced by the input creation process -- when you create a new input field, it's set to be left-aligned. You've had to have changed it to be center-aligned yourself. Change it back.
Logged
jmclaren
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 7
Re: bug in UIInput
«
Reply #2 on:
February 21, 2013, 09:28:59 AM »
We would prefer to be able to use centre alignment too, is this possible for a future release?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: bug in UIInput
«
Reply #3 on:
February 21, 2013, 11:02:00 PM »
Perhaps in the future, sure. You're welcome to submit a patch for it!
Logged
ryan
Jr. Member
Thank You
-Given: 0
-Receive: 1
Posts: 90
Re: bug in UIInput
«
Reply #4 on:
April 03, 2013, 10:35:37 PM »
diff NGUI
-
2
.
5
.
1
/
Assets
/
NGUI
/
Scripts
/
UI
/
UIInput
.
cs
Project
/
Assets
/
NGUI
/
Scripts
/
UI
/
UIInput
.
cs
468c468,
483
<
---
>
else
if
(
mPivot
==
UIWidget
.
Pivot
.
Center
)
>
{
>
label
.
pivot
=
UIWidget
.
Pivot
.
Right
;
>
pos
.
x
-=
label
.
lineWidth
*
0
.
5f
;
>
}
>
else
if
(
mPivot
==
UIWidget
.
Pivot
.
Top
)
>
{
>
label
.
pivot
=
UIWidget
.
Pivot
.
TopRight
;
>
pos
.
x
-=
label
.
lineWidth
*
0
.
5f
;
>
}
>
else
if
(
mPivot
==
UIWidget
.
Pivot
.
Bottom
)
>
{
>
label
.
pivot
=
UIWidget
.
Pivot
.
BottomRight
;
>
pos
.
x
-=
label
.
lineWidth
*
0
.
5f
;
>
}
I realized after making this change that right-aligned labels aren't supported either, or I probably would have made this slightly more elegant. Silly me. Left that as an exercise for the reader.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: bug in UIInput
«
Reply #5 on:
April 04, 2013, 04:30:06 AM »
This also assumes lineWidth was set.
Logged
ryan
Jr. Member
Thank You
-Given: 0
-Receive: 1
Posts: 90
Re: bug in UIInput
«
Reply #6 on:
April 04, 2013, 11:59:46 PM »
So does the existing code just above where that's added.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: bug in UIInput
«
Reply #7 on:
April 05, 2013, 11:59:18 AM »
True!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
bug in UIInput