Author Topic: TouchAdd callback...  (Read 1398 times)

zacho

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +2/-0
    • View Profile
TouchAdd callback...
« on: July 13, 2012, 10:12:42 pm »
Is the callback only valid as the touch is being completed? ie. if a touch within an area is meant to change a variable, is the variable changed as the area is touched, then changes back as the area is released?

nednones

  • Guest
Re: TouchAdd callback...
« Reply #1 on: July 14, 2012, 12:59:32 am »
Should be initialized as soon as a touch is registered

tim

  • Administrator
  • Hero Member
  • *****
  • Posts: 1595
  • Karma: +11/-1
    • View Profile
    • DragonFireSDK
Re: TouchAdd callback...
« Reply #2 on: July 16, 2012, 12:30:41 pm »
The callback is always valid.  It's a flat C function.

Check the event parameter to see what type of touch event is being generated.  (1=down,2=move,3=up)

For example, within your OnTouch() callback:

Code: [Select]
if (event==1)
{
    // Finger went down.
}
else
if (event==2)
{
    // Finger is moving.
}
else
if (event==3)
{
    // Finger has lifted.
}
Tim Sommers
DragonFireSDK Team

zacho

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +2/-0
    • View Profile
Re: TouchAdd callback...
« Reply #3 on: July 19, 2012, 07:32:01 pm »
Thank you for the sample code and feedback guys!