Closed plicatibu closed 10 years ago
The same compiler error happens in the official Phaser example named Display: bitmapdata draw
Orignal JS code:
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);
}
Code in Haxe:
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);
}
The official example example of Phaser named Display: alpha mask works perfectly and without any warning / error.
But it's version converted to Haxe generates the error message
I don't know for sure whether it's a problem with conversion from JS to Haxe or whether it's a problem in the official example of Phaser, but my guess is that it's something related to the way JS works that was not implemented in the Haxe biding.
Original JS code:
Converted code to Haxe: