Skip to content

Feature idea: Sprite.localToWorld and .worldToLocal #11

@JoeStrout

Description

@JoeStrout

Sprites already have the concept of "local" and "world" coordinates, embodied in their localBounds and worldBounds properties.

But sometimes (as in #10), it's handy to convert between these coordinate systems. It might be nice to have localToWorld and worldToLocal methods that do this, taking into account scaling, rotation, and position in the same way that worldBounds does.

This would make it easier to figure out the sprite image pixel under a screen point, though that still will require a bit of math since images are centered on local 0,0.

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