Welcome,
Guest
. Please
login
or
register
.
May 05, 2026, 06:08:46 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
disabling UIImageButton
« previous
next »
Print
Pages: [
1
]
Author
Topic: disabling UIImageButton (Read 4143 times)
serioustommy
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 18
disabling UIImageButton
«
on:
May 29, 2012, 12:09:05 PM »
Currently UIImageButton still responds to mouse events even when it's disabled. Is it possible to do the same fix as UIButtonScale, or is there a reason for this? Thanks!
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: disabling UIImageButton
«
Reply #1 on:
May 29, 2012, 02:25:56 PM »
Sure, change it like so:
void
OnHover
(
bool
isOver
)
{
if
(
enabled
&&
target
!=
null
)
{
target
.
spriteName
=
isOver
?
hoverSprite
:
normalSprite
;
target
.
MakePixelPerfect
(
)
;
}
}
void
OnPress
(
bool
pressed
)
{
if
(
enabled
&&
target
!=
null
)
{
target
.
spriteName
=
pressed
?
pressedSprite
:
normalSprite
;
target
.
MakePixelPerfect
(
)
;
}
}
You will also see this change in the next update.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
disabling UIImageButton