Author Topic: Joystick, DPad, + more with NGUI available  (Read 17332 times)

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Joystick, DPad, + more with NGUI available
« on: June 13, 2012, 01:46:48 PM »
Hello all, I hope it's appropriate to post here since the old "Showcase" forum is disabled, but I'd like to announce that my company has just released Virtual Controls Suite, which is a set of control components for touch screen devices.

I use NGUI myself and so of course made the package fully functional with NGUI.  So, if you're looking for ready to use and fully customizable analog joysticks, dpad, and buttons for your game, check it out!

Product page on our website with more info: http://bitbybitstudios.com/portfolio/virtual-controls-suite/
Asset store link: http://u3d.as/content/bit-by-bit-studios/virtual-controls-suite

-Sean

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #1 on: June 15, 2012, 08:31:19 AM »
Is anybody using this package?  It looks nice, but does it work well? I want to replace my GuiText version.  Has anyone tried this and the free script posted on another page in this forum?  Thanks

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #2 on: June 15, 2012, 01:03:06 PM »
I've used it, but I'm clearly biased  ;)

My pitch for you is that the controls in the suite are very customizable, easy to use, and heavily optimized.  I think it'll save you time and get you perfect feeling controls in your game.

If they're missing something or you have trouble, I'm here to help.  Yesterday I had a new feature request for debug keyboard keys to control the touch controls when in editor, and added them within hours.

Finally, be sure to check out the youtube tutorial for implementing them with NGUI, and the webplayer demo online.

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #3 on: June 15, 2012, 04:58:37 PM »
Ok, I'll bite.  I'll grab a copy tonight and replace my current GUITexture version and see how it goes.  Thanks for the reply.

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #4 on: June 15, 2012, 05:12:35 PM »
Glad to hear it!  Thanks for your support =]  Let me know if I can be of service once you're working with the Suite.
« Last Edit: June 15, 2012, 06:34:51 PM by seandanger »

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #5 on: June 16, 2012, 12:05:23 AM »
Just got it.  The asset store had the updated version.  Looks like a simple matter to swap ou my current controls for the new one.  I'll let you know if I have any troubles.  Thanks.

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #6 on: June 16, 2012, 03:15:38 AM »
I imported the package into my scene and I'm getting a warning about a missing script when I build my project.  I haven't done anything yet with the controls.  I only imported the package and modified the two lines of code as per the instructions.  I have already packed the textures into my atlas.  Is there any reason for me to keep the provided atlas? 

Script attached to 'nguiSuiteAtlas' in scene '' is missing or no valid script is attached.
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #7 on: June 16, 2012, 12:11:20 PM »
You can safely ignore that warning.

That happens because, as I've recently learned, the NGUI example scene has its scripts unlinked since I'm unable to distribute NGUI with the package.  So you can either ignore the warning, or make it go away by either deleting the example atlas, or re assigning a UIAtlas script to the missing component on that prefab.

Sorry for the trouble!

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #8 on: June 16, 2012, 12:29:32 PM »
It's no trouble.  I wish all my problems went away that easily!  I tried replacing my dual analog sticks with your package and I'm having some trouble getting one of the front sprites to be in front of the back sprite.  The depth setting has no effect on it.  I added four new panels under the anchor of my existing ngui hud.  I can interact with both stick and drag them around, but nothing I do brings the front  sprit in front of the base.  The bitch of it is that I deleted the troublesome one from the scene and duped the working one, and then the working one stopped displaying correctly.  I think it's an ngui issue though.  It has been my experience so far that ngui is a temperamental system.  Particularly the editor tools.  They are constantly losing their state, mostly the scale, when I reparent widgets, or collect them under a common game object.  But, that's a rant for a different thread.  Back to VC suite.  Should I put the controls in a separate anchor, or possibly an entirely new ui?

Thanks. 

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #9 on: June 16, 2012, 12:37:03 PM »
I've seen that happen too.  Try changing the Z value of the transform's position on the object you want to stay in front of the other.  If that doesn't work, maybe change the sprites so that the one that happens to be staying in front all the time is changed to be the "moving part".

And about the rest, I agree.  NGUI is great the way it sizes your UI automatically, but it does lead to some confusing editor situations sometimes, especially when re-parenting, just have to watch that scale value.  Let me know if changing the Z or the sprite itself doesn't help and I'll come up with something else :)

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #10 on: June 16, 2012, 12:52:19 PM »
Changing the z value on the sprite didn't do anything, but changing it on the panel that holds the sprite fixed it.  Thanks.  I seem to recall reading that somewhere before.  Anyway, ya, ngui is a fantastic tool destined for greatness.  It's nicely engineered and well written.  But, like all complex system it take time to work out the kinks.  I'll have to rate it, and this package, in the asset store since I highly recommend both.  Cheers.

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #11 on: June 16, 2012, 01:02:49 PM »
Nice work on the controls.  They feel much nicer than the GUITexture version I was using from standard assets mobile. 

I do have one other quick question.  Does the analog joystick support double tap for jumping?
« Last Edit: June 16, 2012, 01:38:01 PM by jdwieber »

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #12 on: June 16, 2012, 05:27:49 PM »
Thanks very much!  I hadn't thought of double tap before, I'll add that today though.  I'll post back here with which code to change so you can add it yourself if you need it sooner than by the time it goes live on the Asset Store.

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #13 on: June 16, 2012, 06:53:17 PM »
Cool.  I haven't looked at the architecture of VC, but it should be an easy addition.  You can probably rip most of the logic from the Standard Assets Mobile Joystick class.  I look forward to the addition.

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #14 on: June 16, 2012, 07:14:45 PM »
Okay, I've updated the Joystick in VCS.  It now has a TapCount property that you can access, and it also has a callback that will be fired one time once TapCount is equal to 2.  You can also adjust in the inspector how much time must elapse before TapCount is reset (default is .2 seconds).  I've PMd you an updated copy, I'll update the actual Asset Store Package later today.

Here's an example of how to use it:

  1. VCAnalogJoystickBase joy = VCAnalogJoystickBase.GetInstance("stick");
  2. joy.OnDoubleTap += JoystickDoubleTapCallback;
  3.  
  4. private void JoystickDoubleTapCallback(VCAnalogJoystickBase joystick)
  5. {
  6.     Fire();
  7. }
  8.  

Alternatively, you could check the TapCount property and see if it's greater than 2, and then fire.  This would fire every frame until TapCount was reset, though.