Sprite width/height set to screen dimensions on clickevent

I’m using the tilesheet api to draw my sprites, i now added a click event to the sprite and noticed that the sprites width/height is set to the windows dimensions rather than the width of the image. Why is that?

    Sprite class:
private var tilesheet:Tilesheet;
    private var bitmapData:BitmapData;
    private var sprite:Sprite;
    public function new() 
        bitmapData = Assets.getBitmapData('img/tree_static.png');
        tilesheet = new Tilesheet(bitmapData);
        sprite = new Sprite();
        tilesheet.addTileRect(new Rectangle(0, 0, 121, 149));
        tilesheet.drawTiles(sprite.graphics, [0, 0, 0], true);
        this.addEventListener(MouseEvent.CLICK, click);

Dunno if relevant but here’s the code for resizing
(Which isn’t 100% working i might add)

function resize(e) 
        if (!inited) init();
        var stageScaleX:Float = stage.stageWidth / Settings.NOMINAL_WIDTH;
        var stageScaleY:Float = stage.stageHeight / Settings.NOMINAL_HEIGHT;
        var stageScale:Float = Math.min(stageScaleX, stageScaleY);
        Lib.current.x = 0;
        Lib.current.y = 0;
        Lib.current.scaleX = stageScale;
        Lib.current.scaleY = stageScale;
        if(stageScaleX > stageScaleY) {
            Lib.current.x = (stage.stageWidth - Settings.NOMINAL_WIDTH * stageScale) / 2;
        } else {
            Lib.current.y = (stage.stageHeight - Settings.NOMINAL_HEIGHT * stageScale) / 2;

Is this HTML5? In that case it’s a known issue with Tilesheet, and I don’t think there’s anything you can do about it.

Aye, i’ve heard of that however, this occurs in Native(windows).

Any idea what could be the cause of it?

In the newer code, it does not try to determine bounds from a drawTiles call, as that might be prohibitively slow to calculate all the matrices, sizes, positions… and defeat the point of drawTiles. I’m on the fence on how we should handle this… :confused:

Alright, thank you. It seems as if I’ll have to go with just drawing bitmaps then to keep it simple. there won’t be that much going on at the same time so hopefully there wont be any performance issues on native.