Skip to content

Commit b79fe8b

Browse files
committed
Fix example
1 parent 3a65527 commit b79fe8b

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

docs/_config.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/ProjectExample/source/TestState.hx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
package source;
22

3-
import vupx.Vupx;
3+
import vupx.core.VpConstants;
44
import vupx.objects.VpText;
55
import vupx.states.VpState;
6+
import vupx.Vupx;
67

78
class TestState extends VpState {
89
var txt:VpText;
910

1011
override public function create():Void {
11-
txt = new VpText(100, 100, "Hello World!", VpConstants.VUPX_DEFAULT_FONT_PATH, 32);
12-
txt.center();
13-
add(txt);
12+
// Create a text object
13+
txt = new VpText(0, 0, "Hello World!", VpConstants.VUPX_DEFAULT_FONT_PATH, 32);
14+
txt.center(); // Center the text on the screen
15+
add(txt); // Add the text object to the state
1416
}
1517

1618
override public function update(elapsed:Float) {
1719
super.update(elapsed);
1820

1921
var speed:Float = 200 * elapsed;
2022

23+
// Move the text
2124
if (Vupx.controller.isPressed(LEFT)) {
2225
txt.x -= speed;
2326
}
@@ -31,6 +34,7 @@ class TestState extends VpState {
3134
txt.y -= speed;
3235
}
3336

37+
// Rotate the text
3438
if (Vupx.controller.isPressed(Y)) {
3539
txt.rotationY += speed;
3640
}
@@ -44,6 +48,7 @@ class TestState extends VpState {
4448
txt.rotationX -= speed;
4549
}
4650

51+
// Move text in Z axis
4752
if (Vupx.controller.isPressed(ZR)) {
4853
txt.z += speed;
4954
}

0 commit comments

Comments
 (0)