How to create button and click exit game in Godot
Hi everyone to day we will show you about how to create cutton and click exit game in godot
ok let's go
.
open your project first
create root tree i will use 2D scene
right click Node2d
choose Add Child Node
type button in search bar then choose Button
change size button up to you
type text for showing text in button
after that we will attach script for exit game
right click Node2D choose attach script
then press create
left click button once
click Node
choose pressed() for create function when press button will create some script we wiill create exit game when pressed .
Click create.
add get_tree().quit() in this function
and save scene
click save
select current
press f5 for test
ความคิดเห็น
แสดงความคิดเห็น