hexonaut / haxe-phaser

Haxe externs for Phaser.
MIT License
51 stars 9 forks source link

Haxe complaining that phaser.gameobjects.BitmapData should be phaser.gameobjects.RenderTexture #19

Closed plicatibu closed 10 years ago

plicatibu commented 10 years ago

The official example example of Phaser named sprites: bitmapadata draw works perfectly and without any warning / error.

But it's version converted to Haxe generates the error message

phaser.gameobjects.BitmapData should be phaser.gameobjects.RenderTexture for function argument 'key'

Official Phaser sample:

var bmd;

function create() {
    bmd = game.add.bitmapData(800, 600);
    bmd.context.fillStyle = 'rgba(255, 0, 0, 0.3)';

    //  Add the bmd as a texture to an Image object.
    //  If we don't do this nothing will render on screen.
    game.add.sprite(0, 0, bmd);
}

Haxe code:

    var bmd:BitmapData;

    function create()
    {
        bmd = game.add.bitmapData(800, 600);

        bmd.context.fillStyle = 'rgba(255, 0, 0, 0.3)';

        //  Add the bmd as a texture to an Image object.
        //  If we don't do this nothing will render on screen.
        game.add.sprite(0, 0, bmd);
    }

You can see the full haxe code here