Skip to content

Add frameClipRect and worldClipRect to FlxSprite #2898

@Geokureli

Description

@Geokureli

Currently, clipRect is defined in the frame's coordinate space, where clipRect.set(0, 0, frameWidth, frameHeight) will show the entire frame. but what if we honor clipRect in FlxBackdrop or FlxTiledSprite, should clipRect tile the clipped frame it, or clip the tiled frame? We almost had a PR to clip post-scaled sprites. I think what we're getting at is there should be two clipRects on sprite, one applied to the frame and another applied when finally drawing to the destination.

Hence frameClipRect and worldClipRect.

To add this we should deprecate clipRect when adding both and, internally, make have a check to use clipRect if it is non-null and frameClipRect is null.

Will likely move this off of 5.4.0 though, as 5.4.0 is big enough

clipRect also lacks decent docs, these could be made more clear by adding docs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions