[phaser] Display number of skeletons in batching test

This commit is contained in:
Mario Zechner 2024-07-02 12:33:05 +02:00
parent bf0a33876a
commit 24995d28b4

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@ -49,6 +50,7 @@
const plugin = this.spine;
let x = 25;
let y = 60;
let n = 0;
for (let j = 0; j < 10; j++, y += 600 / 10) {
for (let i = 0; i < 20; i++, x += 800 / 20) {
const obj =
@ -57,10 +59,12 @@
: this.add.spine(x, y, "raptor-data", "raptor-atlas");
obj.animationState.setAnimation(0, "walk", true);
obj.scale = 0.1;
n++;
}
x = 25;
}
debug = this.add.text(0, 600 - 40, "FPS: ");
this.add.text(0, 600 - 60, "Skeletons: " + n);
}
function update() {
@ -72,4 +76,5 @@
);
}
</script>
</html>