Skip to content

Transform Anchor #12479

Open
Open
@DanielDK05

Description

@DanielDK05

What problem does this solve or what need does it fill?

It would be nice to set an anchor point, like you can on Sprite, on either the transform or mesh.
I am currently creating a game where I would benefit from anchoring the transform on the bottom of the entity.

What solution would you like?

I am envisioning a new component, like this:

enum TransformAnchor {
   Center,
   TopLeftFront,
   TopLeftCenter,
   TopLeftBack,
   TopRightFront,
   Custom(Vec3)
   etc...
}

commands.spawn((
   Transform::default(),
   TransformAnchor::BottomCenter,
));

What alternative(s) have you considered?

An alternative would of course be to just offset the transform manually, but I find that a bit tedious to work with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TransformTranslations, rotations and scalesC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions