Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
TNT Virtual Pad *** VIDEO PREVIEW *** FIRST PUBLIC RELEASE OUT !!! *** DOWNLOAD NOW *** — Gideros Forum

TNT Virtual Pad *** VIDEO PREVIEW *** FIRST PUBLIC RELEASE OUT !!! *** DOWNLOAD NOW ***

Hi! guys!

just an update for my upcoming framework for Gideros Mobile "TNT Virtual PAD"

it's a "virtual" pad/Joystick totally programmable and customizable!

you can have one/two digital/analog pad and 1,2,3 or 4 buttons.

three pad mode (default-fixed, movable and follow finger)
three hide mode (no-hide, Ghost, hide)

more to come... :)

all event driven.

here is an early video!





stay tuned!!!!
TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
www.tntengine.com
+1 -1 (+8 / -1 )Share on Facebook
«13

Comments

  • @Greg, OOPS you did it again... you're on fire...

    would you also have a functionality to lock the joysticks in place rather than move all over the screen?
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • GregBUGGregBUG Guru
    edited April 2012
    @OZApps
    @Greg, OOPS you did it again... you're on fire...
    :)

    would you also have a functionality to lock the joysticks in place rather than move all over the screen?
    has already been implemented ... :)

    PADSTYLE.CLASSIC and lock the joysticks in place
    PADSTYLE.MOVABLE joysticks move when player touch the screen
    PADSTYLE.FOLLOW joysticks move and follow player finger (as in the video)

    ciao ciao
    Gianluca.

    Likes: hgvyas123, gorkem

    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
    +1 -1 (+2 / -0 )Share on Facebook
  • That does look superb, do one of those options give us the ability for the joystick to stay where the initial touch was but move in the direction the user moved from that point?
  • That does look superb, do one of those options give us the ability for the joystick to stay where the initial touch was but movie in the direction the user moved from that point?
    Oh yes is Padstyle.movable ;)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • Excellent, can't wait to try that out, it's just what i've been looking for. I'm in the process of moving my dev from Corona to gideros and it's stuff like this which will make life so much easier :)
  • Super cool. Saves a great deal of time. Great work!
  • thanks guys. i'm very happy that my code can be useful...

    as said on my blog (little update):

    ...development of virtual pad is growing slow but fine!

    it's almost done...

    now i need some beta tester... before public release!!! :)

    if you have in development a game and you need virtual pads or you are interested in "deep" testing my engine
    and want to be a beta tester
    please contact me (remember to leave your email)!!!


    ciao!!!
    Gianluca. gregbug (at) gmail (dot) com

    little new video with "events working":



    Likes: OZApps, gorkem, avo, pmanna

    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
    +1 -1 (+4 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    Count me in. ;)
    Do you have my email address?
  • gorkemgorkem Maintainer
    Me too please.
  • GregBUGGregBUG Guru
    edited April 2012
    ok.! official beta tester :D (in alphabetical order)

    @ar2rsawseen
    @magnusviri
    @gorkem

    i'll send you the sources tonight (when i go home)

    thanks ;)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • [update]

    ok.! new official beta tester :D

    @ar2rsawseen
    @magnusviri
    @gorkem
    @scouser -->> please send me you emails (gregbug at gmail dot com)

    i'll send you the sources tonight (when i go home)

    thanks ;)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • @atilim
    how could I say no to the daddy of Gideros? :P

    [re-update]

    official beta tester :) : (in alphabetical order)

    @ar2rsawseen
    @atilim
    @magnusviri
    @gorkem
    @scouser

    [BETA TEST PROGRAM NOW CLOSED] >:)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • update:

    beta1 just sent to beta tester ! :D :bz

    Likes: avo

    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
  • I'd like to try it too ;)
  • little update...


    beta2 of new framework (TNT Virtual PAD) just sent to beta Testers!!!

    ciao ciao
    Gianluca.
    stay tuned!!!!
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • new update... (pre-beta3)

    just a test run...

    .apk example 2 and 3 of TNT Virtual pad library (only Android device... sorry)

    feedback are welcome! :)

    (this examples are VERY limited examples)
    now virtual pad is totally customizable...
    layers added
    more robust event management
    and optimizations...

    source of example 2...
    -
    -- TNT Virtual Pad for Gideros Mobile SDK
    -- Example 2
    --
    -- Copyright (C) 2012 By Gianluca D'Angelo
    --
     
    -- Setup App
    application:setKeepAwake(true)
    application:setBackgroundColor(0x000000)
     
    -- load background 
    local back = Bitmap.new(Texture.new("sfondo3.png"))
    stage:addChild(back)
     
    -- setup player
    local biPlane = CLASS_biPlane.new()
    stage:addChild(biPlane)
     
    -- setup Virutal Pad
    local vPad = CTNTVirtualPad.new(stage, "tntskinpad",  PAD.STICK_SINGLE, PAD.BUTTONS_TWO, 20,1)
     
    vPad:setPadStyle(PAD.STYLE_FOLLOW)
    vPad:setAnalogMode(PAD.COMPO_LEFTPAD, false)
    vPad:setAnalogMode(PAD.COMPO_RIGHTPAD, true)
    vPad:start()
     
    local function leftJoy(e)
    	if e.data.power > 0.2 then
    		biPlane:move(e.data.angle, (e.data.power*150)*e.data.deltaTime)
    	end
    end
     
    local function rightJoy(e)
    	if e.data.selected then
    		biPlane:setRotation(math.deg(e.data.angle*.786)+90)
    	end
    end
     
    local function fire(e)
    	if e.data.state == PAD.STATE_BEGIN then
    		local fire = CLASS_fire.new(biPlane.xPos, biPlane.yPos-20)
    		stage:addChild(fire)
    	end
    end
     
    local function protection(e)
    	if e.data.state == PAD.STATE_DOWN then
    		biPlane.protection:setVisible(true)
    	else
    		biPlane.protection:setVisible(false)
    	end
    end
     
    vPad:addEventListener(PAD.LEFTPAD_EVENT, leftJoy, self)
    vPad:addEventListener(PAD.BUTTON1_EVENT, fire, self)
    vPad:addEventListener(PAD.BUTTON2_EVENT, protection, self)
    zip
    zip
    example2.apk.zip
    2M
    zip
    zip
    example3.apk.zip
    2M
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • GregBUGGregBUG Guru
    edited May 2012
    little demo preview... running on my iPod 2Gen and iPad 1^ gen.





    hope you like it!

    hey beta tester no bugs found ? :) :D ;;)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • MikeHartMikeHart Guru
    edited May 2012
    Looks great. In my next game I will need something like this. Anyway, good job on it.

    On which iDevice is that demo running on?
  • MagnusviriMagnusviri Member
    edited May 2012
    Works great!

    I noticed that if I press and hold the fire button then press the protection button nothing happens until I release the fire button. I tracked this down the a "break" statement in a for loop in CTNTVirtualPad:onEnterFrame. If the break is removed then it works.

    I've modified my iCade plugin to work interchangably with this. I added this to the bottom of example2 and that's all it takes to add iCade support to a project using TNT Virtual Pad.
    require "icade"
    icade = iCade.new()
    icade:start()
     
    icade:addEventListener(ICADE.LEFTPAD_EVENT, leftJoy, self)
    icade:addEventListener(ICADE.BUTTON7_EVENT, fire, self)
    icade:addEventListener(ICADE.BUTTON8_EVENT, protection, self)
    There is no connection between the iCade behavior and the TNT Virtual Pad. The TNT Virtual Pad will dim automatically and I think that's probably the best way to handle it.

    When using the TNT Virtual Pad and the iCade at the same time, the joysticks add up, which can produce some unintended side effects (moving twice as fast or canceling out the movement). Shooting can be achieved twice as fast as well. I'm not sure how to handle this.

    Obviously there is no iCade right pad and it supports 8 buttons and right now it isn't really configurable. I don't believe there is even anything to configure...

    I did notice some stuttering with my plugin (didn't happen with plugin removed) so maybe I need to optimize it a bit.

    One other annoyance is that when the iCade is connected to the iOS device the keyboard shows then hides. I am not sure how to get around that.

    I'll post a download for the iCade plugin tomorrow.
  • Looks great. In my next game I will need something like this. Anyway, good job on it.

    On which iDevice is that demo running on?
    thanks, mike.!

    it's running on iPod 2^gen and iPad 1^Gen.


    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • GregBUGGregBUG Guru
    edited May 2012
    Works great!

    I noticed that if I press and hold the fire button then press the protection button nothing happens until I release the fire button. I tracked this down the a "break" statement in a for loop in CTNTVirtualPad:onEnterFrame. If the break is removed then it works.
    thanks for the fix.
    looking at the code and try to optimize.


    Obviously there is no iCade right pad and it supports 8 buttons and right now it isn't really configurable. I don't believe there is even anything to configure...

    maybe i can add the 2 missing buttons in Virtual PAD ?

    I'll post a download for the iCade plugin tomorrow.

    nice!


    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • Here is my iCade.lua file and keyinput plugin (iOS only).
    zip
    zip
    iCade.zip
    5K
  • I don't think it matters to add more buttons to TNT Virtual Pad. The iCade has 8 buttons. I don't see how you could possibily add that many buttons to the screen. Maybe one of the buttons on screen can be a pause button, but then it would be implemented differently and not with TNT Virutal Pad, right? The only reason I can think of adding 8 buttons is if you wanted to turn them into some sort of whack-a-mole buttons where they are the majority of what is on screen. So if you wanted to support that then sure.

    Either way, my iCade plugin just produces events with data that looks exactly like TNT Virtual Pad events. The iCade events are named differently though, because I don't want to trigger events twice. I suppose I could name them the same but I think it's better not to.

    This is how I'm deciding to avoid simultaneous input from the on virtual pad and iCade. I added an iCade table field to all iCade generated events. If the event is a Virtual Pad event I record the os.time() and wont evaluate any iCade events if a Virtual Pad event happened in the last second.

    This is the modified example 2.
    local timeVirtualPadLastUsed
     
    local function preventVirtualPadICadeSimultaneousUsage(e)
    	if e.data.icade == true then
    		-- It's the iCade, make sure the virtual pad wasn't used in the last second
    		if os.difftime( os.time(), timeVirtualPadLastUsed ) >= 1 then
    			return true
    		else
    			return false
    		end
    	else
    		-- It's the virtual pad
    		timeVirtualPadLastUsed = os.time()
    		return true
    	end
     
    end
     
    local function leftJoy(e)
    	if preventVirtualPadICadeSimultaneousUsage(e) then
    		if e.data.power > 0.2 then
    			textfield:setText("Power: "..tostring(e.data.power).." Angle: "..tostring(e.data.angle))
    			biPlane:move(e.data.angle, (e.data.power*150)*e.data.deltaTime)
    		end
    	end
    end
     
    local function fire(e)
    	if preventVirtualPadICadeSimultaneousUsage(e) then
    		if e.data.state == PAD.STATE_BEGIN then
    			local fire = CLASS_fire.new(biPlane.xPos, biPlane.yPos-20)
    			stage:addChild(fire)
    		end
    	end
    end
     
    local function protection(e)
    	if preventVirtualPadICadeSimultaneousUsage(e) then
    		if e.data.state == PAD.STATE_DOWN then
    			biPlane.protection:setVisible(true)
    		else
    			biPlane.protection:setVisible(false)
    		end
    	else
    		-- reset everything to defaults to since an iCade button release will now be ignored and could leave the protection on forever
    		biPlane.protection:setVisible(false)
    	end
    end
  • GregBUGGregBUG Guru
    edited May 2012
    I don't think it matters to add more buttons to TNT Virtual Pad. The iCade has 8 buttons. I don't see how you could possibily add that many buttons to the screen.
    yes... you are right!

    This is how I'm deciding to avoid simultaneous input from the on virtual pad and iCade. I added an iCade table field to all iCade generated events. If the event is a Virtual Pad event I record the os.time() and wont evaluate any iCade events if a Virtual Pad event happened in the last second.

    and if i add in Virtual Pad a function like "useIcadeHardware(OnOff)"

    and if user set true (so use icade hardware) virtual pad will not show pad on screen and not release events...

    what do you think ?

    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • GregBUGGregBUG Guru
    edited May 2012
    @Magnusviri

    just sent to you a new version of virtual pad

    with this new functions:
    function CTNTVirtualPad:setICade(onOff)
    function CTNTVirtualPad:getICadeUse()
    the first can set on/off (on if true) the use of iCade...
    simply Virtual pad not showen on screen and not release any event...

    the second release true or false if ICade is used or not...

    i think you need to use the same name of TNT Events for you ICade events...
    so the user simply use vPad:setICade(true) and use ICade
    or vPad:setICade(false)
    and use virtual pad...

    not tested however...

    can you test it ?

    ciao
    gianluca.

    EDIT: in the sources that i sent to you please correct:

    function CTNTVirtualPad:getICaseUse()

    with

    function CTNTVirtualPad:getICadeUse()

    sorry.!
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
Sign In or Register to comment.