Skip to content

flixel.FlxSprite:scale and flixel.FlxSprite:setGraphicsSize() vague descriptions #258

Open
@oscarcederberg

Description

@oscarcederberg

scale

Change the size of your sprite's graphic. NOTE: The hitbox is not automatically adjusted, use updateHitbox() for that (or setGraphicSize()). WARNING: With FlxG.renderBlit, scaling sprites decreases rendering performance by a factor of about x10!

setGraphicsSize()

Helper function to set the graphic's dimensions by using scale, allowing you to keep the current aspect ratio should one of the Integers be <= 0. It might make sense to call updateHitbox() afterwards!

From the description of scale it sounds like setGraphicsSize() will automatically update the hitbox, which it maybe doesn't ("It might make sense to call updateHitbox() afterwards!") according to the description of setGraphicsSize().

It is most likely that the issue lies in setGraphicsSize()'s description, and it should be clarified. Why does it might make sense to call updateHitbox() afterwards? Does it update hitbox or not? If it doesn't, then scale should also be fixed as it implies that setGraphicsSize() does update the hitbox.

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