Table of Contents
src / beginning / chapters / menu / bookmark / bookmark.tscn
Diagram
Overridden virtual functions
_input
func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_accept") && focused:
pressed.emit()
Instantiators
Scene Tree
-
BagBookmark MarginContainer
-
Bookmark Sprite2D
-
Sprite2D Sprite2D
-
-
AnimationPlayer AnimationPlayer
-
Signal Connections
$.:[focus_entered]⇒$.
func _on_focus_entered() -> void:
set_focus(true)
$.:[focus_exited]⇒$.
func _on_focus_exited() -> void:
set_focus(false)
Animations
Animation_ash1f
focus
unfocus
Properties
| Name | Value |
|---|---|
modulate |
|
z_index |
|
custom_minimum_size |
|
anchors_preset |
|
anchor_right |
|
anchor_bottom |
|
offset_right |
|
size_flags_horizontal |
|
focus_mode |
|
script |
| Name | Value |
|---|---|
texture_filter |
|
position |
|
texture |
| Name | Value |
|---|---|
texture |
| Name | Value |
|---|---|
unique_name_in_owner |
|
libraries |
|
bookmark.gd
extends MarginContainer
signal pressed
@export var focused : bool = false : set = set_focus
func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_accept") && focused:
pressed.emit()
func set_focus(val: bool) -> void:
focused = val
if val:
grab_focus()
%AnimationPlayer.play("focus")
else:
%AnimationPlayer.play("unfocus")
func _on_focus_entered() -> void:
set_focus(true)
func _on_focus_exited() -> void:
set_focus(false)

