Skip to content

Add option for custom sort axis for 2d y-sorting #12405

Open
@matidfk

Description

@matidfk

Describe the project you are working on

2D bullet hell game with a unique perspective similar to RotMG. a top down camera that can rotate, and sprites will billboard to point upright

Describe the problem or limitation you are having in your project

when rotating, y-sorting remains based on each sprite's y coordinate. with a rotating camera, for things to be sorted properly, this needs to correspond to a vector.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

allow a custom sort axis setting

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Add a project (or in some other location) setting for a custom sort axis vector (or direction), based on which sprites will be sorted.
eg. the default would be (0, 1). if this vector was changed to (1, 0), now sprites that are towards the +x will be displayed on top.

If this enhancement will not be used often, can it be worked around with a few lines of script?

it can almost be worked around at the moment, by manually setting a sprites z index. however, as z index is an integer type, this loses precision and leads to flickering. additionally, it would be nice to be able to use the z index on top of a custom sort direction.

Is there a reason why this should be core and not an add-on in the asset library?

i dont think it can be implemented as an addon as i believe it requires changing engine source code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions