Welcome,
Guest
. Please
login
or
register
.
January 13, 2025, 06:42:11 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Localization on UISprites: snap them...
« previous
next »
Print
Pages: [
1
]
Author
Topic: Localization on UISprites: snap them... (Read 2970 times)
Ernest
Newbie
Thank You
-Given: 0
-Receive: 1
Posts: 40
Localization on UISprites: snap them...
«
on:
May 25, 2014, 05:11:22 AM »
Hi,
i don't want my localized sprites to be rescaled, but the MakePixelPerfect() function in UILocalize seems to do that (line 50).
How to manage that?! (aside comment the line?)
Ty.
Logged
Nicki
Global Moderator
Hero Member
Thank You
-Given: 33
-Receive: 141
Posts: 1,768
Re: Localization on UISprites: snap them...
«
Reply #1 on:
May 25, 2014, 02:09:43 PM »
It probably should just not MakePixelPerfect there, actually.
As a workaround, you can do something like caching the size you want, and set it back when the localize sets it, but that's a bit ugly.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Localization on UISprites: snap them...
«
Reply #2 on:
May 25, 2014, 08:10:04 PM »
Or just change the sprite to be of Sliced type. Then MakePixelPerfect won't do anything.
Logged
Ernest
Newbie
Thank You
-Given: 0
-Receive: 1
Posts: 40
Re: Localization on UISprites: snap them...
«
Reply #3 on:
June 03, 2014, 03:59:45 AM »
Hey guys, thanks for the answers! Actually making the sprite a sliced sprite don't do the trick... This is because my sprite does not have border so the condition
if
(
t
==
Type
.
Simple
||
t
==
Type
.
Filled
||
!
sp
.
hasBorder
)
in the MakePixelPerfect() function is validated (and it rescale my sprite).
I use the following workaround in UILocalize
if
(
NGUITools
.
FindInParents
<
UIRoot
>
(
sp
.
gameObject
)
.
scalingStyle
==
UIRoot
.
Scaling
.
PixelPerfect
)
sp
.
MakePixelPerfect
(
)
;
because i'm always using a UIRoot setted on FixedSize, but i'm not sure this is a correct behaviour for those using PixelPerfect anyway...
Logged
ilookha
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 1
Re: Localization on UISprites: snap them...
«
Reply #4 on:
July 13, 2014, 02:28:20 PM »
Bumping the thread, since I'm getting the same issue and it's a blocker for me. There's no way to have a localized scaled sprite!
Setting type to "Sliced" doesn't help because of the above mentioned reason.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Localization on UISprites: snap them...
«
Reply #5 on:
July 13, 2014, 05:57:02 PM »
Scale the parent of the sprite, ilookha. Don't scale the sprite. Or just comment out that line if it really bothers you. NGUI comes with full source for a reason.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Localization on UISprites: snap them...