บทความ

กำลังแสดงโพสต์จาก เมษายน, 2023

How to click button count up in Godot

รูปภาพ
 Hi everyone to day i wll going show how to click button count number up in Godot. open your project first. right click Node2D then choose Add Child Node type button in search bar then choose button resize button what you want right click Node2D again choose Attach Script. click create click Node button one time click node then choose pressed() function click create create variable for count number and wil show in screen when press button  function _on_button_pressed(): count += 1 then will plus variable count +1 when press button then click right Node2D again choose Add Child Node type label in search bar when choose Label go to 2D scene change position and resize. i will located it center. then back to script type $Label.text  = str(count) this function it's finished you can press f5 to run when click one time number will appear top here thank you for reading my blog

How to print Hello world in Godot

รูปภาพ
  How to print Hello world in Godot first step open yor project. create scene i use Node2D right click Node2D then click Attach Script click create like this this function will run one time when run game this function will run loop type print("Hello world") in function _ready(): will print Hello world one time then press f5 or click run project button choose select current change name scene what you want then click save Hello world will appear in this. ok it's finish.

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 ok it's work now when we click button game willl exit. thank you very much for reading my article