Button Sensitivity

I’ve downloaded my game to my device in a build and I noticed the buttons were difficult to press.  So I went back and made them larger.   Even with the larger buttons they don’t seem to press as easily as buttons I’ve pressed on other games.  

Is there something I can do to increase the sensitivity?

I thought it might be my phone until I checked it out on other games.  So I don’t think it is my phone.  Also, my buttons are as large or larger than the one’s I pressed on other games.

Thanks

Lori

There is no concept of sensitivity for touches in Corona.  It may be simply the way you’re implementing your buttons.

Can you please paste an excerpt showing how you create a single button and what your touch listener looks like?  This will help a lot.

Oh, and is this on Android or iOS?  I only ask because if its Android, working with you on this will be simpler if examples end up being required.

Finally, if you can, please do this experiment.

  1. Please download and install this game: Android, iOS

  2. Run it and press the buttons on the main menu.  

  3. Write back and tell me if they seem responsive (sensitive) enough.  If no, then … well I don’t know.  But I think the answer will be Yes.  This will give us a direction to go in. i.e. I can show you a button example that should work for you.

Thanks,

Ed

This first one I created a widget button that goes with my widget for level selection.  Then I built a pretty button to put on top.

Item#1:

​ local doneButton = widget.newButton({

       id = “button1”,

       label = “Cancel”,

       onEvent = handleCancelButtonEvent

   })

   doneButton.x = display.contentCenterX; doneButton.y = display.contentCenterY+380   

   sceneGroup:insert( doneButton )

cancelBtn = display.newImage(“Images/cancelBtn.png”)

cancelBtn.isVisible = true

cancelBtn:scale(2, 2)

sceneGroup:insert(cancelBtn)

cancelBtn.x = display.contentCenterX; cancelBtn.y = display.contentCenterY+400

Item#2: My other buttons are like this

​-----------------------------------------------------------------------------

– EVENT FOR PRESSING THE PLAY BUTTON


function startGame(event)

playBtn.isActive = true

  composer.gotoScene(“levelTracker”, “fade”, 400)

return true

end

playBtn = display.newImage(“Images/PLAYmenu2.png”) 

playBtn.x=display.contentCenterX; playBtn.y=display.contentCenterY + 250

playBtn:scale(1.3, 1.3)

playBtn.isActive = true

onRelease = startGame

sceneGroup:insert(playBtn)

It’s like I push and push and nothing …but on others it works fine.  When I’m doing it on the computer with the mouse I don’t have any problems either.

Thanks,

Lori

I have to stop for today but I will down load the game tomorrow.  Can I request it from the App Store?   If not, I’ll open this page in google on my iPad tomorrow and click the link.

Have a great evening.

Lori

for playBtn and cancelBtn, you’re not using widget.newButton() to create the button. You’re using a method of where you create a graphic and then add a touch listener and I don’t see where you’re adding your own touch handler.

Rob

This button works fine right?

​ local doneButton = widget.newButton({ id = "button1", label = "Cancel", onEvent = handleCancelButtonEvent }) doneButton.x = display.contentCenterX; doneButton.y = display.contentCenterY+380 sceneGroup:insert( doneButton )

This bit isn’t a button w/o a listener:

cancelBtn = display.newImage("Images/cancelBtn.png") cancelBtn.isVisible = true cancelBtn:scale(2, 2) sceneGroup:insert(cancelBtn) cancelBtn.x = display.contentCenterX; cancelBtn.y = display.contentCenterY+400

Also, this is wrong:

playBtn = display.newImage("Images/PLAYmenu2.png") ... onRelease = startGame

or rather, I don’t know what it is.

If you want to make a button w/o the widget library it is something like this (there are numerous variations and styles:

local button = display.newImage("Images/PLAYmenu2.png") button.touch = function( self, event ) if( event.phase == "ended" ) then -- Write some code to do something here. end return true end button:addEventListener( "touch" )

Sorry, I think I was brain drained when I wrote my post.  I forgot to include the addEventListener and removeEventListener events which are in my code and I forgot the event to go with the cancel button.  When I turned my phone on this morning they were working fine.  

However, I am going to update my events to be set up like the example you provided.

I really appreciate the help.

Have a wonderful day.

Lori

I down loaded you game - nice job!   The buttons and so forth are working fine - I had no problems.  I’ve tested over 50  levels and the buttons are working fine today.   Thanks

There is no concept of sensitivity for touches in Corona.  It may be simply the way you’re implementing your buttons.

Can you please paste an excerpt showing how you create a single button and what your touch listener looks like?  This will help a lot.

Oh, and is this on Android or iOS?  I only ask because if its Android, working with you on this will be simpler if examples end up being required.

Finally, if you can, please do this experiment.

  1. Please download and install this game: Android, iOS

  2. Run it and press the buttons on the main menu.  

  3. Write back and tell me if they seem responsive (sensitive) enough.  If no, then … well I don’t know.  But I think the answer will be Yes.  This will give us a direction to go in. i.e. I can show you a button example that should work for you.

Thanks,

Ed

This first one I created a widget button that goes with my widget for level selection.  Then I built a pretty button to put on top.

Item#1:

​ local doneButton = widget.newButton({

       id = “button1”,

       label = “Cancel”,

       onEvent = handleCancelButtonEvent

   })

   doneButton.x = display.contentCenterX; doneButton.y = display.contentCenterY+380   

   sceneGroup:insert( doneButton )

cancelBtn = display.newImage(“Images/cancelBtn.png”)

cancelBtn.isVisible = true

cancelBtn:scale(2, 2)

sceneGroup:insert(cancelBtn)

cancelBtn.x = display.contentCenterX; cancelBtn.y = display.contentCenterY+400

Item#2: My other buttons are like this

​-----------------------------------------------------------------------------

– EVENT FOR PRESSING THE PLAY BUTTON


function startGame(event)

playBtn.isActive = true

  composer.gotoScene(“levelTracker”, “fade”, 400)

return true

end

playBtn = display.newImage(“Images/PLAYmenu2.png”) 

playBtn.x=display.contentCenterX; playBtn.y=display.contentCenterY + 250

playBtn:scale(1.3, 1.3)

playBtn.isActive = true

onRelease = startGame

sceneGroup:insert(playBtn)

It’s like I push and push and nothing …but on others it works fine.  When I’m doing it on the computer with the mouse I don’t have any problems either.

Thanks,

Lori

I have to stop for today but I will down load the game tomorrow.  Can I request it from the App Store?   If not, I’ll open this page in google on my iPad tomorrow and click the link.

Have a great evening.

Lori

for playBtn and cancelBtn, you’re not using widget.newButton() to create the button. You’re using a method of where you create a graphic and then add a touch listener and I don’t see where you’re adding your own touch handler.

Rob

This button works fine right?

​ local doneButton = widget.newButton({ id = "button1", label = "Cancel", onEvent = handleCancelButtonEvent }) doneButton.x = display.contentCenterX; doneButton.y = display.contentCenterY+380 sceneGroup:insert( doneButton )

This bit isn’t a button w/o a listener:

cancelBtn = display.newImage("Images/cancelBtn.png") cancelBtn.isVisible = true cancelBtn:scale(2, 2) sceneGroup:insert(cancelBtn) cancelBtn.x = display.contentCenterX; cancelBtn.y = display.contentCenterY+400

Also, this is wrong:

playBtn = display.newImage("Images/PLAYmenu2.png") ... onRelease = startGame

or rather, I don’t know what it is.

If you want to make a button w/o the widget library it is something like this (there are numerous variations and styles:

local button = display.newImage("Images/PLAYmenu2.png") button.touch = function( self, event ) if( event.phase == "ended" ) then -- Write some code to do something here. end return true end button:addEventListener( "touch" )

Sorry, I think I was brain drained when I wrote my post.  I forgot to include the addEventListener and removeEventListener events which are in my code and I forgot the event to go with the cancel button.  When I turned my phone on this morning they were working fine.  

However, I am going to update my events to be set up like the example you provided.

I really appreciate the help.

Have a wonderful day.

Lori

I down loaded you game - nice job!   The buttons and so forth are working fine - I had no problems.  I’ve tested over 50  levels and the buttons are working fine today.   Thanks