Sprite
#HelloGameDev #HelloErmine #HelloWorld2021
Last updated
Was this helpful?
#HelloGameDev #HelloErmine #HelloWorld2021
Last updated
Was this helpful?
เป็นการสร้าง object ที่ภาพมี animation โดยเราจะใช้คำสั่ง this.add.sprite(x,y,'key')
แต่เมื่อเราต้องการให้ภาพ animation นั้นมีระบบฟิสิกส์ ให้เราใช้ this.physics.add.sprite(x,y,'key')
ลงไปใน Create function
ตัวอย่าง
ผลลัพธ์ที่ได้
การหา frameWidth เเละ frameHeight
frameWidth
ความยาวรูป/จำนวนเฟรม
frameHeight
ความสูงของรูป