Author Topic: Best way of emulating iPad/iPhone style scroll page?  (Read 3161 times)

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Best way of emulating iPad/iPhone style scroll page?
« on: July 03, 2012, 11:09:45 PM »
On the iPad for example on the main menu, swiping back and forth switches between pages. Pressing for about 2 seconds on an icon allows you to drag around the icons on the page instead of scrolling of the page. I am trying to do something similiar with my menu.

Right now I have my Drag and Drop panel all working, I have two pages and you can drag to the next page, the problem I have is that the box collider for the screen swipe is below all the icons so it isn't possible to swipe the screen when pressing any of the icons.

Putting the box collider above everything else means that I can swipe the screen properly but then it is not possible to click on any of the buttons since the collider already catches everything. Is there any way in NGUI to emulate that press and hold feature or would it be better to try and write something myself?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Best way of emulating iPad/iPhone style scroll page?
« Reply #1 on: July 04, 2012, 02:25:43 AM »
Why not have the swipe script on your buttons as well? That's how dragging works. Not only is the drag script on the background, but it's also on the buttons.

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Best way of emulating iPad/iPhone style scroll page?
« Reply #2 on: July 04, 2012, 10:11:20 PM »
The problem with that is, it was difficult to know when you would be dragging an object and swiping the screen since they both occupy the same space. In the end we have just decided to get rid of the swiping to the next screen and have a button instead, it also makes it easier to navigate. We had arrows flashing at the edges of the screen to show that you could swipe but instead people just clicking the arrows. So in the end we just changed them to buttons.

Who would have thought menu design could become so complicated to get feeling right. :)

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Best way of emulating iPad/iPhone style scroll page?
« Reply #3 on: July 12, 2012, 05:15:51 AM »
Sorry to bring up my old thread. But I am now interested in trying to get this feature to work.

I have a scrollable panel, using the usual UIPanel and UIDraggable Panel. If I hold the button down for about a second I want to be able to drag the Card out of the Window.

Except when I do click on a object the Panel still continues to drag, not only that, I can't drag it out of the UIPanel, it just vanishes off the edge of the dimensions that I set for the UIPanel.

Anyone else having any luck with doing something like this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Best way of emulating iPad/iPhone style scroll page?
« Reply #4 on: July 12, 2012, 08:36:17 AM »
Look into how drag & drop example works. After moving any widget to another panel you need to call its CheckParent() function. While dragging your card, disable the UIDraggablePanel script on it.