Welcome,
Guest
. Please
login
or
register
.
April 27, 2026, 06:20:47 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How do I know the button is being pressed?
« previous
next »
Print
Pages: [
1
]
Author
Topic: How do I know the button is being pressed? (Read 7798 times)
bodosaher
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 22
How do I know the button is being pressed?
«
on:
September 11, 2013, 06:43:48 PM »
I need to know if a button is being pressed, I dont a method that is being called as long as the button is held down?
Does onPress do that because i feel it only simulates the first click?
Logged
Wumpee
Jr. Member
Thank You
-Given: 3
-Receive: 0
Posts: 53
Re: How do I know the button is being pressed?
«
Reply #1 on:
September 11, 2013, 07:20:29 PM »
OnPress is only called when the button is initially pressed, or when it is released.
You could do something like the following if you want to know when the button is held down:
public
bool
Held
{
get
;
protected
set
;
}
void
OnPress
(
bool
pressed
)
{
Held
=
pressed
;
}
Logged
bodosaher
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 22
Re: How do I know the button is being pressed?
«
Reply #2 on:
September 11, 2013, 07:34:11 PM »
Thanks wumpee
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How do I know the button is being pressed?