Advanced buttons panel for my demo app

Hello,

I’m a new Corona SDK user but since I’m not a programmer or code expert I’ve found the Kwik plugin that is helping me a lot. I’ve made a demo app to start out my learning. I post here the help request I’ve posted also in the kwik forum. I’ve learned basic a bit to make an adventure game with AGS but when it comes to complex coding (maybe complex for me) I’m stuck.

Here I need to make 6 buttons that can be switched on and off (with a click sound for each, each time the user tap on them)

Then I’d like to make some variables/conditions and depending from the position of each button another audio clip and image appears. If you know how to help me feel free to ask me more and I go into details. Thanks!

image.png

local widget = require "widget" local buttonSound = audio.loadSound( "click.mp3" ) local function handleButtonClick (event) if ( event.phase == "began" ) then local buttonChannel = audio.play(buttonSound) end return true end local button1 = widget.newButton( left = 100, top = 200, id = "button1", label = "tester", onEvent = handleButtonClick )

Something like that should do the trick. You can take a look at the widget and audio docs here:

https://docs.coronalabs.com/api/library/widget/index.html

https://docs.coronalabs.com/api/library/audio/index.html

Thanks for your answer, I’ll give a look into the corona files code generated from the plugin. Can you link me some more tutorials for condition events. For example how can I tell to start audio clip or a layer to show depending from the buttons position?

Since my app is all here and it’s just for testing I can share if anyone is interested in helping me with the code. Thanks

Here: https://coronalabs.com/blog/2015/09/01/tutorial-treasury-widgets/

Any kind programmer or kwik expert (the photoshop plugin) that would like to give a check at my project. I’ve read some tutorial but there is no kwik explanations. I’ll post here a link with the full folder that you can load into kiwk (i’m using version 2).

Assuming buttons A-B-C-D-E-F for example, and these buttons are layers (i have 1 layer for on position and 1 layer for off position each).

I want that another layer (text) and an audio clip will load depending from the A-B-C-D-E-F buttons. For example let say A-B are on and the rest is off. Do I need some array table or some global variables?  Thanks

local widget = require "widget" local buttonSound = audio.loadSound( "click.mp3" ) local function handleButtonClick (event) if ( event.phase == "began" ) then local buttonChannel = audio.play(buttonSound) end return true end local button1 = widget.newButton( left = 100, top = 200, id = "button1", label = "tester", onEvent = handleButtonClick )

Something like that should do the trick. You can take a look at the widget and audio docs here:

https://docs.coronalabs.com/api/library/widget/index.html

https://docs.coronalabs.com/api/library/audio/index.html

Thanks for your answer, I’ll give a look into the corona files code generated from the plugin. Can you link me some more tutorials for condition events. For example how can I tell to start audio clip or a layer to show depending from the buttons position?

Since my app is all here and it’s just for testing I can share if anyone is interested in helping me with the code. Thanks

Here: https://coronalabs.com/blog/2015/09/01/tutorial-treasury-widgets/

Any kind programmer or kwik expert (the photoshop plugin) that would like to give a check at my project. I’ve read some tutorial but there is no kwik explanations. I’ll post here a link with the full folder that you can load into kiwk (i’m using version 2).

Assuming buttons A-B-C-D-E-F for example, and these buttons are layers (i have 1 layer for on position and 1 layer for off position each).

I want that another layer (text) and an audio clip will load depending from the A-B-C-D-E-F buttons. For example let say A-B are on and the rest is off. Do I need some array table or some global variables?  Thanks