Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Zooming by buttons.
Started by llordglassenward87 Apr 11 2019 05:39 PM

2 replies to this topic
zoom
[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

llordglassenward87

[GLOBAL: userInfoPane.html]
llordglassenward87
  • Observer

  • 18 posts
  • Corona SDK

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!



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,601 posts
  • Corona SDK

[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,601 posts
  • Corona SDK

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.




[topic_controls]
[/topic_controls]