Skip to content

Sprite3d: bottom/origin anchor for ground placement (2.5D) #1514

Description

@obiot

Context

Sprite3d (added in #1513) renders a centered quad. For 2.5D characters (Paper Mario-style), you almost always want the sprite's feet on the ground, which currently means manually offsetting pos.y by half the height.

Proposal

Add an anchor / origin option so the pivot can be placed at the bottom-center (feet), e.g. originPoint: { x: 0.5, y: 1 } or a simple anchor: "bottom" shorthand, applied as a constant offset baked into the local quad (so it composes with billboarding/flip and doesn't affect the cull bounds).

  • Default stays centered (no behavior change).
  • Should work across all billboard modes and with trimmed/rotated atlas frames.

Acceptance

  • new Sprite3d(x, y, { ..., originPoint: { x: 0.5, y: 1 } }) plants the bottom edge at pos.
  • Unit test: corner Y offsets shift by the origin; billboard projection still upright.

Refs: docs note in 2.5D Games ("Ground anchoring" caveat).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions