Welcome,
Guest
. Please
login
or
register
.
May 25, 2026, 12:49:17 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
ios Touch.pressure
« previous
next »
Print
Pages: [
1
]
Author
Topic: ios Touch.pressure (Read 2735 times)
slipstream
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 5
ios Touch.pressure
«
on:
October 26, 2016, 03:07:48 AM »
Hello,
Is that possible in NGUi to return the pressure of a touch?
Right now i have a button with a NGUI UIEventTrigger and OnPress Event.
How can i get the pressed touch pressure?
Thanks a lot, i struggle to find out..
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: ios Touch.pressure
«
Reply #1 on:
October 30, 2016, 12:09:04 PM »
Check UICamera.ProcessTouches function.
int
count
=
(
UICamera
.
GetInputTouchCount
==
null
)
?
Input
.
touchCount
:
UICamera
.
GetInputTouchCount
(
)
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
var
touch
=
(
UICamera
.
GetInputTouch
==
null
)
?
Input
.
GetTouch
(
i
)
:
UICamera
.
GetInputTouch
(
i
)
;
// <-- actual Unity touch
// do whatever you want with it
var
nguiTouch
=
UICamera
.
GetTouch
(
touch
.
fingerId
)
;
// <-- this gives you the corresponding NGUI touch
}
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
ios Touch.pressure