playMaker

Author Topic: Swipe to switch object.  (Read 1786 times)

detomato

  • Playmaker Newbie
  • *
  • Posts: 36
Swipe to switch object.
« on: March 03, 2015, 01:24:48 AM »
Hi all, need some help here. Already searched the forum, but nothing came out.

I need to do swipe action to switch character, ie character selection screen.
Say I have 5 character which is A, B, C, D and E. It start with character A on the screen, and when I swipe left, it will switch to character B, and if I switch again, it will switch to character C, or if I swipe to right, it will switch to character A.

Basically its a 'next' and 'previous' character from a list or something. Wonder if ArrayList can do something like that, but I still haven't learn how to utilize it.

Thanks in advance.

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Swipe to switch object.
« Reply #1 on: March 03, 2015, 04:40:07 PM »
Have the characters lined up next to each other in the scene (with a gap inbetween).

Use the Swipe Gesture Event and everytime the player swipes left, go to a state where the camera moves to the next player. Repeat.

detomato

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Swipe to switch object.
« Reply #2 on: March 03, 2015, 04:47:30 PM »
Thanks for the reply, but no good. Coz I'm using Vuforia AR. It need to be able to create and destroy character from a list.

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Swipe to switch object.
« Reply #3 on: March 03, 2015, 04:56:03 PM »
Just do the same thing as I said but also activate/deactivate the characters to make them become visible at the right time. This sounds more like a design choice than a code problem really. You could also move the characters along the Z axis out of view /depth of the camera so they disappear/reappear that way also.