Change labelYOffset in onPress and onRelease events of ButtonWidget

Can this only be passed in with the options parameter when creating the button? Someone else had the same issue, and it went unanswered. Here’s the link:

https://forums.coronalabs.com/topic/33872-change-yoffset-of-button-label-on-event/

The widget.newButton does not support this feature. However there are a couple of options.

If you have to have text buttons, I believe you can change the color of the button text as it’s pressed and released.

You could use an image button. Have two graphics, one that has the offset and one that doesn’t.

You can download the widget source code from our github repository and modify widget.newButton to your needs. We have open sourced the code.  https://github.com/coronalabs/framework-widget

Rob

I’m actually using an icon font for the icons on my buttons (to make them appear smooth despite the screen resolution). I ended up rolling my own solution. Thanks for pointing me at the source though, I didn’t know it was available! It would be awesome if the label of the button widget was exposed so we could control it manually.

The widget.newButton does not support this feature. However there are a couple of options.

If you have to have text buttons, I believe you can change the color of the button text as it’s pressed and released.

You could use an image button. Have two graphics, one that has the offset and one that doesn’t.

You can download the widget source code from our github repository and modify widget.newButton to your needs. We have open sourced the code.  https://github.com/coronalabs/framework-widget

Rob

I’m actually using an icon font for the icons on my buttons (to make them appear smooth despite the screen resolution). I ended up rolling my own solution. Thanks for pointing me at the source though, I didn’t know it was available! It would be awesome if the label of the button widget was exposed so we could control it manually.