src / beginning / chapters / chapter / chapter.tscn

Diagram

Diagram

Assets

200

Scene Tree

  • Chapter MarginContainer

    • Placeholder TextureRect

    • Sprite2D Sprite2D

    • AnimationPlayer AnimationPlayer

Signal Connections

$.:[focus_entered]⇒$.
func _on_focus_entered() -> void:
	if focus_animation_skip: focus_animation_skip = false
	else: %AnimationPlayer.play("focused")

Animations

Animation_ue4pb

Diagram

focused

Diagram

opening

Diagram

selected

Diagram

unselected

Diagram

Properties

Table 1. Root properties
Name Value

anchors_preset

-1

anchor_right

0.083

anchor_bottom

0.148

offset_right

0.639984

offset_bottom

0.160004

focus_mode

2

theme_override_constants/margin_left

20

theme_override_constants/margin_top

20

theme_override_constants/margin_right

20

theme_override_constants/margin_bottom

20

script

Table 2. $Placeholder properties
Name Value

unique_name_in_owner

true

custom_minimum_size

Vector2(120, 0)

layout_mode

2

Table 3. $Sprite2D properties
Name Value

z_index

4

z_as_relative

false

texture_filter

2

position

Vector2(77, 72)

texture

Chapter 0
Figure 1. res://assets/images/ui/Chapters/Chapter_0.png
Table 4. $AnimationPlayer properties
Name Value

unique_name_in_owner

true

libraries

{ &"": SubResource("AnimationLibrary_rglud") }

chapter.gd

extends MarginContainer

@export var play_opening := false : set = set_play_opening
@export var resource : ChapterResource
var focus_animation_skip := false


func set_play_opening(val: bool) -> void:
	if val: %AnimationPlayer.play("opening")


func focus_returned() -> void:
	focus_animation_skip = true
	grab_focus()
	focus_animation_skip = false


func selected() -> void:
	%AnimationPlayer.play('selected')


func unselected() -> void:
	%AnimationPlayer.play('unselected')


func _on_focus_entered() -> void:
	if focus_animation_skip: focus_animation_skip = false
	else: %AnimationPlayer.play("focused")