Author Topic: iOS style page switching for NGUI (demo and sources)  (Read 3324 times)

NikolayLezhnev

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 4
    • View Profile
iOS style page switching for NGUI (demo and sources)
« on: August 12, 2014, 06:20:59 AM »
Hello, I made iOS style page switching for NGUI.

It's work similar to iOS desktop pages - you can change page by drag or by fast swipe.
You can see demo here:
https://www.youtube.com/watch?v=7aqQ6KRc_V4

How to use it:
1. Open new unity project
2. Import NGUI 3.6.8 unity package
3. Import "IosStylePageSwitcher.unitypackage"
4. Open scene IosPageSwitcher.scene and hit 'Play' button

I hope to see this functionality in future releases or NGUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #1 on: August 12, 2014, 07:25:25 AM »
That's pretty cool, thanks for sharing!

Cho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #2 on: December 30, 2014, 09:50:25 PM »
ngui 3.6.8 ver Only does it work?

Cho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #3 on: December 30, 2014, 09:53:57 PM »
Assets/NGUI/Scripts/Interaction/UICenterOnChild.cs(53,59): error CS1061: Type `UIScrollView' does not contain a definition for `centerOnChild' and no extension method `centerOnChild' of type `UIScrollView' could be found (are you missing a using directive or an assembly reference?)



my ngui ver 3.7.7

error

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #4 on: December 31, 2014, 03:56:53 PM »
Clearly you are not on 3.7.7, as UIScrollView.centerOnChild is there, line 876.

Cho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #5 on: January 06, 2015, 12:13:14 AM »
ngui 3.6.8 ver Only does it work?

answer Yes or No


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #6 on: January 06, 2015, 11:00:23 AM »
No, it was added later. You need to update.

Cho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #7 on: January 11, 2015, 09:44:39 PM »
Unity ver 4.6.1
NGUI ver 3.7.7


....

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: iOS style page switching for NGUI (demo and sources)
« Reply #8 on: January 12, 2015, 01:16:39 AM »
UIScrollView line 875 and 876:
  1.         [HideInInspector]
  2.         public UICenterOnChild centerOnChild = null;