Premium Only Content
Button GUI with Scene Transition #defold
Creating a Button for any GUI in Defold plus adding some functionality with switching to a new scene.
As promised: Code for each script used in video
----------Code Snippet----------
loader.script
local function show(self, proxy)
if self.current_proxy then
msg.post(self.current_proxy, "unload")
self.current_proxy = nil
end
msg.post(proxy, "async_load")
end
function init(self)
msg.post(".", "acquire_input_focus")
self.current_proxy = nil
msg.post("#", "show_game_over")
end
function on_message(self, message_id, message, sender)
if message_id == hash("show_game_over") then
show(self, "#game_over")
elseif message_id == hash("show_main") then
show(self, "#main")
elseif message_id == hash("proxy_loaded") then
self.current_proxy = sender
msg.post(sender, "enable")
end
end
~loader.script
game_over.gui_script
function init(self)
msg.post(".", "acquire_input_focus")
end
function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then
local button = gui.get_node("button")
if gui.pick_node(button, action.x, action.y) then
msg.post("00000:/loader#loader", "show_main")
print("button clicked!")
end
end
end
~game_over.gui_script
-----------Code Snippet----------
--
Subscribe to the Channel for more content, Like the video, Share the video, and Comment suggestions or to show your support!!!
Provide Thoughts on the channel and join the email list - https://bit.ly/3hG99wP
Check out my Social Media to reach out to me!
Twitter - https://twitter.com/vigmu2
Discord - https://discord.gg/AYEAK5RmFR
To check out my Podcast - https://anchor.fm/vigmu2-games
New shows uploaded every Friday at 8AM (until further notice)
If you would like to donate for my current work and for further content! You can donate here -- https://bit.ly/3ea8q3u
-
58:04
Kimberly Guilfoyle
1 hour agoFBI's Terror Response Failures, Live with Steve Friend & Kyle Seraphin | Ep. 185
29.3K21 -
LIVE
WeAreChange
2 hours agoMassive Developments In Vegas Investigation! UNREAL DETONATION, Shocking Details Emerge!
2,816 watching -
1:02:55
In The Litter Box w/ Jewels & Catturd
21 hours agoAmerica Is Under Attack! | In the Litter Box w/ Jewels & Catturd – Ep. 711 – 1/02/2025
57.1K24 -
1:45:25
The Quartering
4 hours agoHuge Update In Cybertruck Attack & Dark New Details From New Orleans Attacker & More!
90.5K44 -
3:21:21
DemolitionDx
4 hours agochecking out multiple games
33K -
2:14:38
Conspiracy Pilled
1 day agoPortal to Hell: The Elisa Lam/Cecil Hotel Case (S5 Ep 12)
40.3K4 -
14:31
DeVory Darkins
1 day ago $8.73 earnedScott Jennings Drops Brutal TRUTH BOMB
38.3K153 -
LIVE
cbsking757
6 hours ago★TANKING RIVALS RANKED! GIFTED SUBS ARE LIVE! #marvel #marvelrivals
138 watching -
4:04:55
Tate Speech by Andrew Tate
13 hours agoEMERGENCY MEETING EPISODE 99 - 2024 - TIME VACUUM
233K110 -
26:14
Breaking Points
5 hours agoSH*TSHOW: FBI Retracts False Info on NOLA Attacker
55.6K30