Add a testing Text object to the existing level
authorMatt Mullins <mokomull@gmail.com>
Sat, 16 Jun 2012 04:52:04 +0000 (21:52 -0700)
committerMatt Mullins <mokomull@gmail.com>
Sat, 16 Jun 2012 05:07:25 +0000 (22:07 -0700)
LevelFns.h
levelworld.yaml [new file with mode: 0644]

index d4d7db6..f6d4d87 100644 (file)
@@ -2,6 +2,7 @@
 #define __LEVELFNS_H__
 #include "Game.h"
 #include "Level.h"
+#include "Text.h"
 #include "SDL_ttf.h"
 ///\file LevelFns.h this file should contain all Behaviors for Levels
 
@@ -29,6 +30,10 @@ void LevelWorldLoad() {
        Sprite* sun = new Sprite("sun", l->getAnimation("sun.anim"));
        sun->setPosition(480,50);
        sun->setSpeed(1);
+
+       Text* helloworld = new Text("levelworld.yaml", "hello", English, 20, WHITE, 300, 20);
+       helloworld->setPosition(120, 150);
+       l->addText(helloworld);
 }
 
 void LevelWorldUpdate() {
@@ -53,4 +58,4 @@ void LevelWorldUpdate() {
        }
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/levelworld.yaml b/levelworld.yaml
new file mode 100644 (file)
index 0000000..52d3fc6
--- /dev/null
@@ -0,0 +1,2 @@
+en:
+    hello: Hello, World!