Skip to content

[4.0.0-rc.6] tilesprite size vs origin vs position #7244

@Antriel

Description

@Antriel
preload() {
    this.load.image('pic', 'assets/sprites/space-baddie.png');
}
create() {
    this.test1 = this.add.tileSprite(320, 200, 100, 100, 'pic');
}
update() {
    this.test1.setSize(200, 200); // Change size _after_ creating instance.
}

Before the new renderer, the new size respected the origin, i.e. in this example it would grow out from center (default origin being 0.5). Local to global X/Y remains at origin (global changes).
In new renderer the "center" point moves with the size change, i.e. the tilesprite's top-left point does not move, and it only expands bottom-right. Local to global X/Y remains fixed (relative to local changes).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions