Skip to content

Animated Tile objects don't retain scale during animation. #241

@133794m3r

Description

@133794m3r

When using Tiled's Animation system the scale of any object is lost upon the tile switching to it's next animation frame. I believe this bit of code is the issue.

j.batch:set(j.id, t.quad, j.x, j.y, j.r, tile.sx, tile.sy, 0, j.oy)

local t = self.tiles[tonumber(tile.animation[tile.frame].tileid) + self.tilesets[tile.tileset].firstgid]

Since for a tile image based object the tile.sx is going to be the normal 1 or -1 without the additional scaling factor that was calculated when indexing over it in setObjectSpriteBatches(layer)

local sx = object.width / tile.width

The issue seems to be that the instance's information is being overwritten when the tile is updated and it's not taking into account the sx that was calculated based upon the size of the tile itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions