Zooming by buttons.

https://www.youtube.com/watch?v=UXH7O0ttcQw

Hi,

So I stumbled across this Roaminggamer’s video (code in desc.)

It is exactly what I need, a zoom defined by ‘+’ and ‘-’ buttons. I just have some widget buttons which I want to be affected by it. How do I make that, what do I put and remove when code for mine widget button looks like this and I want this function based button to be zoomed in along with the rest? Also how to change texture and position of existing ‘+’ and ‘-’ buttons? I just couldn’t find out.

local widget = require("widget") local Sound1 = audio.loadSound("beep.mp3") local button\_Sound1\_Press = function(event) audio.play(Sound1) end local button\_Sound1 = widget.newButton { defaultFile = "key.png", overFile = "key2.png", onPress = button\_Sound1\_Press, } button\_Sound1.x = display.contentCenterX; button\_Sound1.y = display.contentCenterY

Thanks!

That doesn’t look like my code.  

Original post:

https://forums.coronalabs.com/topic/73040-scaling-displaygroup/

Code:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/06/zoomingInAndOut.zip

Note: I don’t typically use widget buttons, as I have my own button library.

… additionally, that example simply scales a group that contains objects.  So, if you wanted to scale buttons you could put them in a group and scale the group.  However… that will have negative side-effects, but I’ll let you try it and see, then you can play around with the idea to see how to solve it.

That doesn’t look like my code.  

Original post:

https://forums.coronalabs.com/topic/73040-scaling-displaygroup/

Code:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/06/zoomingInAndOut.zip

Note: I don’t typically use widget buttons, as I have my own button library.

… additionally, that example simply scales a group that contains objects.  So, if you wanted to scale buttons you could put them in a group and scale the group.  However… that will have negative side-effects, but I’ll let you try it and see, then you can play around with the idea to see how to solve it.