HaxePunk / HaxePunk

Cross-platform desktop, mobile, and WebGL game engine, based on FlashPunk
MIT License
489 stars 126 forks source link

Spritemap doesn't render #26

Closed thejustinwalsh closed 11 years ago

thejustinwalsh commented 12 years ago

I seem to be having an issue with spritemap not displaying any data to the screen, the entity is there, however the image is not. :(

Here is the code I am using, pulled from the tutorial on the website. This code is in my entities added() function.

    _sprite = new Spritemap("gfx/ship.png", 18, 18);
    _sprite.add("idle", [0]);
    _sprite.play("idle");
    this.graphic = _sprite;

Just for good measure, the image data appears appropriately when using this code instead.

    this.graphic = new Image("gfx/ship.png");

I am using haxe 2.10, nme 3.4.0, and HaxePunk 1.6.6 from haxelib.

jgroeneveld commented 12 years ago

assuming your problem happens on the cpp target: the problem is Spritemap.hx:70 - 72

override public function updateBuffer(clearBefore:Bool = false)
{
  #if cpp
    return;
  #end    

i removed the #if cpp lines and the spritemap renders on cpp as well as it does on flash. no idea why this code is in...