carenalgas/popochiu

Props with vertical frames aren't supported

Closed this issue · 1 comments

Bug description

Only sprites with horizontal frames are processed properly

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a prop and give it a spritesheet with frames organised vertically
  2. Set the number of Frames to 1
  3. Set the number of V Frames to the number of vertical frames the sprite has
  4. Try to set the Current Frame to anything other than 0

Expected vs observed behavior

A sprite sheet with any combination of vertical or horizontal frames should be supported.

Environment information (please complete):

  • Windows 10
  • Godot 4.4 dev2
  • Popochui 2.0.0

Additional context

You can see from the set_current_frame function in popochui_prop.gd that v_frames isn't accounted for

func set_current_frame(value: int) -> void:
	current_frame = value
	if not has_node("Sprite2D"): return

	if current_frame >= $Sprite2D.hframes:
		current_frame = $Sprite2D.hframes - 1

	$Sprite2D.frame = current_frame

It should presumably be

if current_frame >= $Sprite2D.hframes * $Sprite2D.v_frames:

Found this is fixed in commit 668182e on the develop branch