Permalink
Browse files

Work on the status UI

  • Loading branch information...
1 parent 8a55c97 commit d831d448d4affd0d1c24b4ba9e7863219f4728c0 Amos Wenger committed Apr 21, 2012
Showing with 19 additions and 2 deletions.
  1. +1 −0 BUILD.md
  2. BIN assets/fonts/impact.ttf
  3. +7 −0 log.txt
  4. +3 −1 source/game/Level.ooc
  5. +8 −1 source/ui/MainUI.ooc
View
@@ -18,6 +18,7 @@ Put these in your `OOC_LIBS`:
* <https://github.com/nddrylliog/ooc-gobject>
* <https://github.com/eagle2com/ooc-sdl>
* <https://github.com/nddrylliog/ooc-cairo>
+ * <https://github.com/nddrylliog/ooc-freetype2>
## How to build
View
Binary file not shown.
View
@@ -92,4 +92,11 @@ Sat Apr 21 22:32:15 CEST 2012
Was not correctly clearing and blitting the screen using SDL + Cairo, now we can get events
and display stuff. Yay!
+=========================
+
+Sat Apr 21 23:13:52 CEST 2012
+
+Apparently fonts are not loaded correctly, let's try to debug that.
+
+
View
@@ -41,6 +41,7 @@ Level: class {
ui: MainUI
// each player controls a part of the world
+ mainPlayer: Player
players := ArrayList<Player> new()
// citizens make their own decision on how to spend their money
@@ -50,7 +51,8 @@ Level: class {
ui = engine ui
// single-player mode
- players add(Player new("Gob"))
+ mainPlayer = Player new("Gob")
+ players add(mainPlayer)
}
ticks: Long = 0
View
@@ -46,11 +46,18 @@ MainUI: class {
bgPass := Pass new(this, "bg") // clear
levelPass := Pass new(this, "level") // level terrain etc.
hudPass := Pass new(this, "hud") // human interface (windows/dialogs etc.)
+
+ // status sprites
statusPass := Pass new(this, "status") // various info
+ levelTitle: LabelSprite
initPasses: func {
// TODO: setup bg pass & status pass
- bgPass addSprite(Sprite new(vec2(40, 40)))
+ bgPass addSprite(Sprite new(vec2(40, 80)))
+
+ levelTitle = LabelSprite new(vec2(30, 30), "<level name>")
+ levelTitle color set!(1.0, 1.0, 1.0)
+ statusPass addSprite(levelTitle)
reset()
}

0 comments on commit d831d44

Please sign in to comment.