Welcome,
Guest
. Please
login
or
register
.
April 30, 2026, 04:47:04 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Help on UIWidget / UISprite coloring of the ColorTint?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Help on UIWidget / UISprite coloring of the ColorTint? (Read 2864 times)
SuperTalesNat
Guest
Help on UIWidget / UISprite coloring of the ColorTint?
«
on:
May 13, 2013, 04:10:54 AM »
So i've been trying to get this to work to no avail.
There's multiple objects in the hierarchy that all need to be changed, hence the for loop.
Any help would be GREATLY appreciated.
Color RecColor
=
new
Color
(
0
,
255
,
0
,
255
)
;
UISprite
[
]
recColor
=
RecBorder
.
GetComponentInChildren
<
UISprite
>
(
)
.
color
;
foreach
(
UISprite u
in
recColor
)
{
recColor
=
RecColor
;
}
Logged
dlewis
Guest
Re: Help on UIWidget / UISprite coloring of the ColorTint?
«
Reply #1 on:
May 13, 2013, 04:56:53 AM »
You're never actually accessing the sprite (and there for the color component) in the for loop
Logged
SuperTalesNat
Guest
Re: Help on UIWidget / UISprite coloring of the ColorTint?
«
Reply #2 on:
May 13, 2013, 10:47:21 AM »
Duhr, that'll teach me to try and code, and then ask a dumb question at 2am.
Got a good nights sleep (kind of) and saw the issue this morning as well.
Color RecColor
=
new
Color
(
0
,
255
,
0
,
255
)
;
UISprite
[
]
recColor
=
RecBorder
.
GetComponentsInChildren
<
UISprite
>
(
)
;
foreach
(
UISprite u
in
recColor
)
{
u
.
color
=
RecColor
;
}
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Help on UIWidget / UISprite coloring of the ColorTint?
«
Reply #3 on:
May 13, 2013, 10:55:54 AM »
255 is invalid when creating a Color. Color values range from 0 to 1. You're creating a Color, passing Color32's parameters there.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Help on UIWidget / UISprite coloring of the ColorTint?