Skip to content

Instantly share code, notes, and snippets.

@duncanbeevers
Created April 5, 2011 23:10
Show Gist options
  • Save duncanbeevers/904775 to your computer and use it in GitHub Desktop.
Save duncanbeevers/904775 to your computer and use it in GitHub Desktop.
package {
import net.flashpunk.Entity;
import net.flashpunk.FP;
import net.flashpunk.graphics.Graphiclist;
import net.flashpunk.graphics.Text;
public class HUD extends Entity {
[Embed(source = "assets/fonts/pf_tempesta_seven.TTF", embedAsCFF=false, fontFamily = "what")]
public var myvar:String;
private var g:Graphiclist = new Graphiclist();
private var a:Text = new Text('' , 8, 8, 480, 480);
public function HUD() {
g.add(a);
graphic = g;
layer = -1000;
a.font = "what";
}
override public function update():void {
a.scrollX = a.scrollY = 0;
a.text = "X: " + int(Player.coords.x) + "\r\nY: " + int(Player.coords.y);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment