Quick Links: Gideros Home | Download Gideros | Developer Guide
TNT Virtual Pad *** VIDEO PREVIEW *** FIRST PUBLIC RELEASE OUT !!! *** DOWNLOAD NOW ***
  • GregBUGGregBUG +1 -1 (+7 / -1 )
    Guru
    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
  • looks good
  • @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 +1 -1 (+2 / -0 )
    Guru
    @OZApps
    OZApps said:

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



    :)

    OZApps said:


    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
  • 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!
  • GregBUGGregBUG +1 -1 (+4 / -0 )
    Guru
    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
  • ar2rsawseenar2rsawseen +1 -1
    Maintainer
    Count me in. ;)
    Do you have my email address?
  • gorkemgorkem +1 -1
    Maintainer
    Me too please.
  • 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
  • GregBUGGregBUG +1 -1 (+1 / -0 )
    Guru
    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
  • 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)
    example2.apk.zip
    2M
    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
  • 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
  • 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?
  • 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.
  • MikeHart said:

    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
  • 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).
    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
  • 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
  • @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
  • I will try it out tomorrow!
  • This is awesome stuff. I want to use this in my next platformer. My goal is to use this virtual pad if QWERTY keyboard or joypad is not available.

    I'm looking to make my game compatible with the following hardware

    icade mobile
    gametel
    xperia play
    android QWERTY keyboard phones like Droid 4

    Let me know what you think and what we can do to make this happen.

  • @glennbjr thanks!

    for iCade @Magnusviri is working on his plugin and we are trying to make it working with VPAD

    about gametel, xperia play, and droid4 i don't know anything about it... :O

    but we can try to do something... :D
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • atilimatilim +1 -1
    Maintainer
    @glennbjr I'm planning to add Xperia Play support officially. Let me add gametel to the list also. (I haven't known gametel before)

    @Magnusviri We also want to support iCade. When the time comes, I'm really glad if it is possible to add your plugin to the official Gideros distribution?
  • atilimatilim +1 -1
    Maintainer
    go @GregBUG go!
    cheerleader.gif
    60 x 44 - 2K
  • GregBUGGregBUG +1 -1 (+3 / -0 )
    Guru
    UPDATE: B-)

    TNT Virtual PAD is OUT!!!
    download now!!! as usual.... it's free! :)
    B-)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • Thank you very much for this, i'll give it a go this week.
  • @atilim, feel free to include it. It is only a side thing I'm working on so if anyone else picks it up feel free. I have a few outstanding issues with it still and if I get them solved I'll let you know. I created a webpage that I'll keep up to date with the status (as well as posting on this forum).

    http://blog.magnusviri.com/gideros-icade-plugin.html
  • evsevs +1 -1
    Member
    @GregBUG Great Stuff!!!


    cheers

    evs
  • @evs
    @pixelknights
    @glennbjr
    @all thanks guys!!!
    hope to see soon some games that uses TNT Virtual PAD ! ;;)

    @Magnusviri
    have you tested beta3.5 with your iCade ? :-/
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • pixelknightspixelknights +1 -1 (+1 / -0 )
    Member
    Greg, I'm sure I saw a "donate" link on your site, but can't seem to find it now? All this hard work must be appreciated so I want to send a donation. Where do I send it?

    ta

    Likes: gorkem

  • @pixelknights thanks for your support,

    for donation just go to my site, then go to download page then click "donate" button (under tnt virtual pad).

    remember to leave your email so i can send you the sources.

    thanks again
    Gianluca.
    :P
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • Ah that was it, I knew i'd seen it somewhere, donated, keep up the good work :)
  • atilimatilim +1 -1
    Maintainer
    @Magnusviri thank you! we'll have an iCade soon so that I can contribute to and test your plugin.

    @GregBUG Also xperia play and gametel is on the list. It would be great if TNT Virtual PAD combines all these controllers. go go go! :)
  • @GregBUG I'm using TNT Virtual PAD in my new platformer and it's working really great. I should have a video of WIP of the game and a donation to you next week. :)
  • @glennbjr :P thanks for your support!

    can't wait for WIP video ! ;;)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • @glennbjr wow... very very cool.
    parallax is stunning!!!

    and graphics is nice too !!!
    very very good job!!!

    if you'll need a teste i'm here!!!
    :D
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID

In this Discussion

Top Posters