playMaker

Author Topic: PlayMaker Touch 2D Object Events - Move vs Began  (Read 2716 times)

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
PlayMaker Touch 2D Object Events - Move vs Began
« on: January 31, 2019, 12:19:01 PM »
What is the point of the "Touch Began" event?  It seems useless since no matter what I do, the Touch Object 2D event always registers the "Touch Moved" event as well.

Basically, if I touch my finger on my phone and move it down the screen at the same time, I want my initial "Touch Began" event to be ignored because I am just trying to scroll down the screen, not touch an actual button...and Vise Versa, if I am just trying to press a button, it shouldn't think I am trying to move my finger down the screen.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker Touch 2D Object Events - Move vs Began
« Reply #1 on: February 04, 2019, 04:13:58 AM »
Hi,

 Touch began allows you to initialize values or store the initial position or whatever you want to keep for computation during touch move.

 it is essential for complex features as it prevents to run a check and maintain some bool variables during touch move event.

I also strongly suggest that when you design complex features in your game you also have a XXX BEGAN, XXX PROCESSING and XXX ENDED type of events so that any other fsm or othe features can really fully grasp what's going, it's especially true for animated menus, and all these fancy process that don't happen directly or are asynchronous, like loading something from the internet.


Bye,

 Jean