class

PointClickEngine::UI::DialogPortrait

Inherits Reference < Object

Animated character portrait for dialog scenes

Constructors

new(character_name : String)
Source

Instance methods

add_expression_frames(expression : PortraitExpression, frame_rects : Array(RL::Rectangle), frame_duration : Float32 = 0.1_f32)

Add animation frames for a specific expression

Source
add_mouth_frames(mouth_rects : Array(RL::Rectangle))

Add mouth animation frames for talking

Source
animation_speed
Source
animation_speed=(animation_speed : Float32)
Source
character_name
Source
character_name=(character_name : String)
Source
cleanup

Cleanup resources

Source
current_expression
Source
current_expression=(current_expression : PortraitExpression)
Source
current_frame

Animation state

Source
current_frame=(current_frame : Int32)

Animation state

Source
draw(screen_pos : RL::Vector2)

Draw the portrait at the specified screen position

Source
fade_alpha

Visual effects

Source
fade_alpha=(fade_alpha : Float32)

Visual effects

Source
frame_timer
Source
frame_timer=(frame_timer : Float32)
Source
frames
Source
frames=(frames : Hash(PortraitExpression, Array(PortraitFrame)))
Source
get_screen_position(screen_width : Int32, screen_height : Int32, character_pos : RL::Vector2 | Nil = nil) : RL::Vector2

Get screen position based on portrait position setting

Source
hide(fade_out : Bool = true)

Hide portrait with fade-out effect

Source
is_blinking
Source
is_blinking=(is_blinking : Bool)
Source
load_texture(path : String) : Bool

Load portrait texture from file

Source
mouth_frame_index
Source
mouth_frame_index=(mouth_frame_index : Int32)
Source
mouth_frames

Mouth animation for talking

Source
mouth_frames=(mouth_frames : Array(RL::Rectangle))

Mouth animation for talking

Source
mouth_speed
Source
mouth_speed=(mouth_speed : Float32)
Source
mouth_timer
Source
mouth_timer=(mouth_timer : Float32)
Source
portrait_texture
Source
portrait_texture=(portrait_texture : RL::Texture2D | Nil)
Source
position
Source
position=(position : PortraitPosition)
Source
scale
Source
scale=(scale : Float32)
Source
set_expression(expression : PortraitExpression, immediate : Bool = false)

Set current expression with smooth transition

Source
show(fade_in : Bool = true)

Show portrait with fade-in effect

Source
size
Source
size=(size : RL::Vector2)
Source
start_talking

Start talking animation

Source
stop_talking

Stop talking animation

Source
talking
Source
talking=(talking : Bool)
Source
tint
Source
tint=(tint : RL::Color)
Source
update(dt : Float32)

Update portrait animations

Source
visible
Source
visible=(visible : Bool)
Source