Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Question on Virtual Pad — Gideros Forum

Question on Virtual Pad

Tom2012Tom2012 Guru
edited November 2012 in General questions
Just downloaded the fantastic TNT Virtual Pad.

One question - how do I detect a release of the pad?

Here's the code that I came up with from reading the pdf
local function rightJoy(e)
 
	if e.data.selected then
	print(e.data.state)
		carro:rotateCannone(e.data.angle)
 
	end
 
	if e.data.state == "PAD.STATE_END" then
		print("Ended")
	end
end
But it prints either 15 or 16 and doesn't detect the end state.

Thank you

Comments

  • i think is a bug... :((
    check as soon as possible... ;;)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • I haven't used the TNT Virtual Pad yet, but just glancing at the code, if it prints 15 or 16 then those must be constants defined in it to check. My guess is you don't want quotes around PAD.STATE_END because PAD.STATE_END is probably one of those constants (probably 15 or 16). Since you're checking if e.data.state is equal to that string, it never finds a match.
  • GregBUGGregBUG Guru
    edited November 2012
    as said by @zvardin in code snippet there is an error "PAD.STATE_END" is a constant (number 17 in that case)

    anyway PAD.STATE_END (only for pad) is not working on v1.10 fixing now tomorrow i'll update! (Buttons events are working btw)

    sorry for the inconvenience! :P
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • the correct code should be:
    local function rightJoy(e)
     
    	if e.data.selected then
    		carro:rotateCannone(e.data.angle)
    	end
     
    	if e.data.state == PAD.STATE_END then
    		print("Ended")
    	end
    end

    TNT Virtual PAD is FIXED NOW
    i'll update tomorrow!

    thanks for support!.

    ciao.

    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • @GregBUG

    Another question on Virtual Pad...

    Is there any way to define the area which the pad registers a touch. To be able to say set a max radius, outside of which the pad is not active?

    Thanks - I think this is a fantastic tool by the way!
  • GregBUGGregBUG Guru
    edited November 2012
    @tom2012

    no... with current version... :(

    maybe i can add in next version...


    a command like this should be fine for example ?
       vPad:setMaxRadius(40)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • That would be fantastic! :D
  • Another quick question... on the joypad, the joystick image (smaller circle) appears behind the larger translucent circle. Is there a way to set it the other way around?
  • Another quick question... on the joypad, the joystick image (smaller circle) appears behind the larger translucent circle. Is there a way to set it the other way around?
    ...eheheh ... my eyes are old and tired ... @-)

    it's fixed now...

    an update will come soon (with setMaxRadius) suggested by you.
    thanks.
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • GregBUGGregBUG Guru
    edited November 2012
    Hi! guys…
    a little update for my TNT Virtual PAD.

    This is a BUG Fix Release

    Fixed Events Release for Virtual PADS
    Fixed GFX Layer Error on Virtual PAD
    Add a new Touch modality based on radius
    so now Virtual pad can handle touches also on user defined radius. (see docs and examples for more infos)

    Thanks to @Tom2012 for Bug reports and suggestions.
    and thanks to all peoples that support my work with donations! (thanks guys!)

    www.tntengine.com

    Likes: ar2rsawseen

    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Hi GregBUG - excellent news. However there might be a problem. When running the examples I get:

    "error loading module 'tntvpad64' from file './tntvpad64.lua':
    ./tntvpad64.lua: bad header in precompiled chunk
    stack traceback:"

    Thanks

    Tom
Sign In or Register to comment.