Skip to content

Cannot rotate sprite properly #105

@EliasZ

Description

@EliasZ

Great library but I am finding difficulties with rotating a sprite properly. I used to work with this:

context.save();
context.beginPath();
context.translate(xCenter, yCenter);
context.scale(1, 0.5);
context.scale(2.75, 2.75);
context.rotate(-rot);
context.translate(-128, -128);
context.drawImage(image, 0, 0);
context.closePath();
context.restore();

The result is an isometric rotation.

But with JawsJS I find it hard to invoke these methods on the context in that order because the draw function is very limited. What would be a correct approach?

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