Welcome,
Guest
. Please
login
or
register
.
September 07, 2024, 11:48:56 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
iOS Scrolling Emulation
« previous
next »
Print
Pages: [
1
]
Author
Topic: iOS Scrolling Emulation (Read 4093 times)
mixd
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 22
iOS Scrolling Emulation
«
on:
November 18, 2012, 07:02:31 PM »
I would ask for this as a feature request, but I'll leave that up to Aren. Here is some code that anyone can drop in their project to make your scrolling windows feel more like native iOS scrolling. The change is subtle yet makes a huge improvement!
[in]
UIDraggablePanel.cs
[change]
// Move the panel
MoveAbsolute
(
offset
)
;
[to]
// Move the panel
Vector3 constraint
=
mPanel
.
CalculateConstrainOffset
(
bounds
.
min
, bounds
.
max
)
;
if
(
constraint
.
magnitude
>
0
.
001f
)
{
MoveAbsolute
(
offset
/
2f
)
;
mMomentum
/=
2f
;
}
else
{
MoveAbsolute
(
offset
)
;
}
«
Last Edit: November 18, 2012, 07:19:00 PM by mixd
»
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: iOS Scrolling Emulation
«
Reply #1 on:
November 18, 2012, 08:00:19 PM »
Try your code with the framerate limit disabled (vsync off).
Logged
mixd
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 22
Re: iOS Scrolling Emulation
«
Reply #2 on:
November 19, 2012, 03:07:58 PM »
Is this something you would consider adding and/or suggest the proper way to make this work? (Tried w/o vsync and it seemed ok but I was not sure what I was looking for)
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: iOS Scrolling Emulation
«
Reply #3 on:
November 19, 2012, 04:12:46 PM »
Ok I looked deeper into your changes. I misunderstood what happens originally. Looks fine to me, I'll integrate them into the main repo, thanks.
Logged
nah0y
Sr. Member
Thank You
-Given: 1
-Receive: 2
Posts: 430
\o/
Re: iOS Scrolling Emulation
«
Reply #4 on:
November 20, 2012, 10:04:13 AM »
Hum, I've tried your code and it doesn't seem to do anything different with or without :s
Is it something really visible ??
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: iOS Scrolling Emulation
«
Reply #5 on:
November 20, 2012, 03:41:51 PM »
Took me a while to see the effect as well, nah0y. Try dragging the contents past the bounds. It halves the drag amount, making it seem like there is some resistance being applied.
Logged
Nicki
Global Moderator
Hero Member
Thank You
-Given: 33
-Receive: 141
Posts: 1,768
Re: iOS Scrolling Emulation
«
Reply #6 on:
November 20, 2012, 05:14:50 PM »
This is excellent for iOS apps as we can match the native behavior better. Good job, mixd!
Logged
nah0y
Sr. Member
Thank You
-Given: 1
-Receive: 2
Posts: 430
\o/
Re: iOS Scrolling Emulation
«
Reply #7 on:
November 21, 2012, 12:14:52 PM »
Nice !
Yup, closer but still not the same fluid feeling we have on an iOS list. And I don't think we will get near that using Unity (am I right ?).
PS : You're going to include this for the next release right ?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: iOS Scrolling Emulation
«
Reply #8 on:
November 21, 2012, 05:32:23 PM »
Yeah, Pro users already have it in the repo.
Logged
nah0y
Sr. Member
Thank You
-Given: 1
-Receive: 2
Posts: 430
\o/
Re: iOS Scrolling Emulation
«
Reply #9 on:
November 21, 2012, 06:41:20 PM »
I should consider getting the pro version
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
iOS Scrolling Emulation