Welcome,
Guest
. Please
login
or
register
.
June 14, 2026, 07:10:58 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Scrollable menu
« previous
next »
Print
Pages: [
1
]
Author
Topic: Scrollable menu (Read 4010 times)
MaxUylings
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 23
Scrollable menu
«
on:
September 25, 2012, 05:54:54 AM »
Hey,
I want to create a menu for iOS to select different worlds. What I did was I took the example nr7 from the documentation to create a scrollable list of buttons. Then I created the following script to make sure that when you swipe the buttons do not get clicked. I was wondering what you guys think about the way I did this.
#pragma strict
enum
WereldTrigger
{
OnPress,
OnRelease,
}
var
trigger
:
WereldTrigger
=
WereldTrigger
.
OnPress
;
var
scene
:
String
;
function OnPress
(
isPressed
:
boolean
)
{
if
(
this
.
transform
.
position
.
x
<
0
.
001f
&&
this
.
transform
.
position
.
x
>
-
0
.
001f
)
{
Debug
.
Log
(
"Position is correct"
)
;
if
(
!
isPressed
&&
trigger
==
WereldTrigger
.
OnRelease
)
{
Application
.
LoadLevel
(
scene
)
;
Debug
.
Log
(
"Button clicked"
)
;
}
}
else
{
Debug
.
Log
(
"Button Swiped"
)
;
}
}
Kind Regards,
Max Uijlings
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Scrollable menu
«
Reply #1 on:
September 25, 2012, 08:33:37 AM »
There is a similar threshold setting already present on the UICamera.
Logged
MaxUylings
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 23
Re: Scrollable menu
«
Reply #2 on:
September 26, 2012, 04:35:57 AM »
Thank you that works better then my solution. I just had one question the numbers that you specify "mouse drag threshold
4
" is that in pixels?
Kind Regards,
Max Uijlings
Logged
PhilipC
Guest
Re: Scrollable menu
«
Reply #3 on:
September 26, 2012, 08:23:52 AM »
Yes that should be in pixels.
Logged
MaxUylings
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 23
Re: Scrollable menu
«
Reply #4 on:
September 26, 2012, 09:07:34 AM »
Great thanks!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Scrollable menu