Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

SSK2: Will a one/two touch joystick interfere with other button events?
Started by Blex Oct 15 2017 02:19 PM

10 replies to this topic

Best Answer roaminggamer , 15 October 2017 - 02:45 PM

One last reply for now.  You said 'one touch joystick' but that is not a thing in SSK2.  In SSK2 I provide these easy input creators:

  • One Touch - Whole screen as button.
  • Two Touch - Screen split in middle horizontal emulating two buttons.
  • One Stick - A joystick that has two modes. 
  • Two Stick - Screen is split with two joysticks, one on each half of screen.
  • One Stick + One Touch - Half-screen is joystick pad, half is button.  (Swap-able via configuration in call to builder.)

 

Lastly, the library supplies a joystick factory so you can build them directly and control where they go a little more easily.

 

When using the factory, there is a critical argument called 'inputObj' that controls how touches are processed. See the docs.

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Blex

[GLOBAL: userInfoPane.html]
Blex
  • Corona Geek

  • 1,199 posts
  • Corona SDK

I am currently using a one-touch joystick and I was wondering if I create different buttons and press them will the joystick appear on top of that button? If so, how can I fix that? Thank you!



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,489 posts
  • Corona SDK

Hi.  Are you saying that when you click the button the joystick also appears?

 

Are you returning 'true' from your button listener?



[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,489 posts
  • Corona SDK

Oh, and how are you making your buttons?  Widget Lib?  SSK2?  Other?



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,489 posts
  • Corona SDK

Note: There are a lot of ambiguities here because there are so many ways to set up the joystick and buttons.  

 

I'd need to see you project in all likelihood to figure out what you've got mis-configured.



[TOPIC: post.html]
#5

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,489 posts
  • Corona SDK

I updated the Easy Inputs Sampler:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/SSK2/kernels/inputs_Easy/001_easyInputs.zip

 

See the example called 'One Stick + Two Buttons' in "scripts/oneStickPlusButtons.lua" 

 

Found on RG_FreeStuff: https://github.com/roaminggamer/RG_FreeStuff/

 

Under the SSK2 folder: https://github.com/roaminggamer/RG_FreeStuff/SSK2/

>> https://github.com/roaminggamer/RG_FreeStuff/tree/master/SSK2/kernels/inputs_Easy

 

I don't think this will help you, but I wanted to clearly demonstrate the joysticks and buttons can co-exist with no issues. 



[TOPIC: post.html]
#6

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,489 posts
  • Corona SDK

  Best Answer

One last reply for now.  You said 'one touch joystick' but that is not a thing in SSK2.  In SSK2 I provide these easy input creators:

  • One Touch - Whole screen as button.
  • Two Touch - Screen split in middle horizontal emulating two buttons.
  • One Stick - A joystick that has two modes. 
  • Two Stick - Screen is split with two joysticks, one on each half of screen.
  • One Stick + One Touch - Half-screen is joystick pad, half is button.  (Swap-able via configuration in call to builder.)

 

Lastly, the library supplies a joystick factory so you can build them directly and control where they go a little more easily.

 

When using the factory, there is a critical argument called 'inputObj' that controls how touches are processed. See the docs.



[TOPIC: post.html]
#7

Blex

[GLOBAL: userInfoPane.html]
Blex
  • Corona Geek

  • 1,199 posts
  • Corona SDK

Wow, you've bombarded me! I'll take a look at the example. 

 

Also, when I meant one touch, I meant one stick/two stick. Sorry for the confusion.

 

Cheers, 

Alex



[TOPIC: post.html]
#8

Blex

[GLOBAL: userInfoPane.html]
Blex
  • Corona Geek

  • 1,199 posts
  • Corona SDK

Hi.  Are you saying that when you click the button the joystick also appears?

 

Are you returning 'true' from your button listener?

So far, I have not added a button, I am just asking for the sake of knowing. I hope I don't seem lazy.

 

I will probably use SSK2 to create the buttons. I have considered going "full SSK2" on this project just to explore some of its features. 



[TOPIC: post.html]
#9

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,489 posts
  • Corona SDK

Sigh... next time try it.  I thought you did and had trouble.

 

Yes, buttons work fine if constructed correctly and added AFTER you create the joystick easy helper  AND/OR if you add the buttons in a layer above the widget.

 

You may get into trouble if the joystick widget is above the buttons in the draw order.



[TOPIC: post.html]
#10

Blex

[GLOBAL: userInfoPane.html]
Blex
  • Corona Geek

  • 1,199 posts
  • Corona SDK

I have looked at the example and it seems as if your buttons work quite well with the joystick.



[TOPIC: post.html]
#11

Blex

[GLOBAL: userInfoPane.html]
Blex
  • Corona Geek

  • 1,199 posts
  • Corona SDK

Sigh... next time try it.  I thought you did and had trouble.

 

Yes, buttons work fine if constructed correctly and added AFTER you create the joystick easy helper  AND/OR if you add the buttons in a layer above the widget.

 

You may get into trouble if the joystick widget is above the buttons in the draw order.

Sorry about that! Thank you for the recommendations.




[topic_controls]
[/topic_controls]