Stencyl 3.4.0 is now out. Get it now!

Virtual Joysticks Extension [3.1]

thinkster

  • Posts: 149
Hahaha nevermind, apparently macs automatically unzip it. Just had to zip it up again! I'll get round to testing it now!

thinkster

  • Posts: 149
Got it working for my game on iPad.

Pretty awesome!

Going to change the look of the joy sticks though. I want some transparency in there.

I see you have to name the new .png the same as the old ones. Would there be a way to have different files for different joysticks?

I have duel controls, one for movement one for attacking. I would like to have the joysticks looking different than each other?

Abliblablobla

  • *
  • Posts: 524
I have just updated the original post with a "To Do" list as a reminder for what I would like to add to this extension based on users suggestions. Before adding new features I would like to gather more feedbacks. I am also waiting for a comprehensive documentation for the upcoming Image API which could greatly simplify the features I am planning to add.

@thinkster
Thank you for your feedback! Which iPad do you have (2, 3, 4, Air)? I have added your suggestions to the original post.
.: BuruBuru :.

thinkster

  • Posts: 149
iPad 3!

It works really well. I'll be able to test it on iPhone 4 and 5 in the next couple of weeks. Looking forward to further developments with the extension, great work!  :)

Abliblablobla

  • *
  • Posts: 524
I have just updated this extension! In this new version there are a lot of new features and improvements: see the first post to know more details about this update. As always, feedback and suggestions are welcome!
.: BuruBuru :.

sumguy67

  • Posts: 20
Thanks so much for doing this! Works well and is very helpful.

Abliblablobla

  • *
  • Posts: 524
You are welcome!
Can I ask to you what device are you testing this extension with?
.: BuruBuru :.

sideofcode

  • Posts: 21
Thanks, Abliblabobla, for putting this together. I've been testing it out on an iPhone 5 and Nexus 7. So far, it seems to work well.

I do have a couple of issues to report, as well as a quick question.

First, maybe I overlooked something, but a relative joystick I created in one scene seems to persist into other scenes. In this case, the joystick would be created in a level but persist when I exited back to the level-chooser scene. I ended up adding a block right before the scene transition to remove the joystick. Just wondering if the clean-up should normally happen automatically and maybe I missed something. Or maybe there's a way of getting a list of all existing joysticks to ensure that everything does get cleaned up.

The second issue is that the Set Default Direction block doesn't seem to take effect until after a joystick is touched. I created a relative joystick and immediately after set the default direction to 270. However, the joystick direction is reported as 0 until I actually touch the screen. I've attached a quick sample.

And then my question is this: Is it necessary to have all of the 1x, 1.5x, 2x, and 4x versions of the joystick images in the extras directory? If 4x version is there, can the others be created at build time? Or if I'm not using any scaling at all, is it sufficient to just have the 1x version?

Abliblablobla

  • *
  • Posts: 524
You are welcome!

1) In some games it is very handy not to initialize your virtual joysticks every time you have a scene change. For example, you can imagine a top-down shooter level which has ten rounds and each round is a different scene. As of now you can initialize the joysticks just once at the beginning of the level and remove them when the player loses, instead of initializing them for ten times. In this way you have less code (or blocks) in your game so that your behaviors/actors/scenes look cleaner, easier to read and easier to modify.

2) Thank you for reporting this issue. This is definitely a bug. I have just uploaded a new version of this extension that should include a fix for this issue. Let me know if it works as expected now!

Is it necessary to have all of the 1x, 1.5x, 2x, and 4x versions of the joystick images in the extras directory? Or if I'm not using any scaling at all, is it sufficient to just have the 1x version?
I think that you must have at least the 1x images for your joysticks. If in your settings you set "Max Scale" to 1, you don't need 1.5x, 2x and 4x versions for your images. If "Max Scale" is set to 4, you must include all the 1x, 1.5x, 2x and 4x versions for your images.

If 4x version is there, can the others be created at build time?
No, that would require a toolset extension.
.: BuruBuru :.

sideofcode

  • Posts: 21
Ah, I see your point about not initializing the joystick too often. Still, I wouldn't mind seeing a block that would give me a list of existing joysticks or maybe a for-each-joystick loop. Without blocks like that, I believe I'd need to use game attributes or some other type of game-wide variable/constant to ensure I'm using the same joystick ID across scenes.

ErLuiSS

  • Posts: 125
this is the same than stencyl joysticks?

Abliblablobla

  • *
  • Posts: 524
this is the same than stencyl joysticks?

No, it's not the same. The main differences are:
1) This extension works everywhere (iOS, Android, Flash, Mac and PC).
2) This extension supports scaling and different aspect ratios.
3) You can have more than two joysticks.
4) You can have more control over your joysticks (look at the documentation for detailed descriptions of every block of this extension).
.: BuruBuru :.

Minimo

  • Posts: 201
This extension is awesome !

johantri

  • Posts: 64
I try this extension in Ubuntu 14.04, it doesn't even recognize the zip file and Stencyl is searching for image file instead. Help..

It works on windows though, however when i try to switch the animation (when i change the direction of the joystock), it only shows the first frame of animation. How come?

joeldom

  • Posts: 35
alright i'm  stuck on how to properly install this....not sure where to stick the extras folder I keep getting errors when I try to import the resources