Goutte/godot-addon-animated-shape-2d

Support for metadata on shape frames

Closed this issue · 1 comments

Goutte commented

This only needs a public endpoint to access the current shape frame, if any.

Rationale

I'm also using this plugin to add extra information on each animation frame, and it's been delightful for things like is_before_slash on startup frames.

Using this in AnimatedShape2D, and a get_meta on the result when not null:

func get_current_shape_frame() -> ShapeFrame2D:
	var animation_name := self.animated_sprite.get_animation()
	var frame := self.animated_sprite.get_frame()
	return self.shape_frames.get_shape_frame(animation_name, frame)

The metadata records are added in the Editor, as metadata of a single ShapeFrame2D. Shallow and deep copies seem to work as expected.

image

You don't have to use a special metabox to use Metadata, you can use the hitbox directly for example, but I've found it to be less messy.

Goutte commented

See d531384 .