PopochiuProp
Extends: PopochiuClickable
Description
Property Descriptions
texture
@export var texture: Texture2D
- Setter:
@texture_setter
The image to use as the [member Sprite2D.texture] of the [b]$Sprite2D[/b] child.
frames
@export var frames: int = 1
- Setter:
@frames_setter
The number of horizontal frames this node's texture image has. Modifying this will change the value of the [member Sprite2D.hframes] property in the [b]$Sprite2D[/b] child.
v_frames
@export var v_frames: int = 1
- Setter:
@v_frames_setter
The number of vertical frames this node's texture image has. Modifying this will change the value of the [member Sprite2D.vframes] property in the [b]$Sprite2D[/b] child.
current_frame
@export var current_frame: int = 0
- Setter:
@current_frame_setter
The current frame to use as the texture of this node. Modifying this will change the value of the [member Sprite2D.frame] property in the [b]$Sprite2D[/b] child. Trying to assign a value lesser than 0 will make this property to be 0, and trying to assign a value higher than the number of total frames will make this property to be code - 1[/code].
link_to_item
@export var link_to_item: String = ""
Links the prop to a PopochiuInventoryItem. This will make the prop disappear from the room, depending on whether or not said inventory item is inside the inventory.
Method Descriptions
queue_change_frame
func queue_change_frame(new_frame: int) -> Callable
Changes the value of the [member Sprite2D.frame] property to [param new_frame] in the [b]$Sprite2D[/b] child.[br][br] [i]This method is intended to be used inside a [method Popochiu.queue] of instructions.[/i]
change_frame
func change_frame(new_frame: int) -> void
Changes the value of the [member Sprite2D.frame] property to [param new_frame] in the [b]$Sprite2D[/b] child.
set_texture
func set_texture(value: Texture2D) -> void
set_frames
func set_frames(value: int) -> void
set_v_frames
func set_v_frames(value: int) -> void
set_current_frame
func set_current_frame(value: int) -> void
Signals
- signal linked_item_removed(item): Emitted when the [param item] linked to this object (by [member link_to_item]) is removed from the inventory. This may happen when the inventory item dissapears forever from the game.
- signal linked_item_discarded(item): Emitted when the [param item] linked to this object (by [member link_to_item]) is discarded from the inventory. This may happen when the inventory item dissapears forever from the game.