File tree Expand file tree Collapse file tree
DefaultLayoutParts/Layer_VN_Textbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ enum AnimationsNewText {NONE, WIGGLE}
7373@export var next_indicator_show_on_questions : bool = true
7474@export var next_indicator_show_on_autoadvance : bool = false
7575@export_enum ('bounce' , 'blink' , 'none' ) var next_indicator_animation : int = 0
76- @export_file ("*.png" ,"*.svg" ) var next_indicator_texture : String = ''
76+ @export_file ("*.png" ,"*.svg" , "*.tres" ) var next_indicator_texture : String = ''
7777@export var next_indicator_size : Vector2 = Vector2 (25 ,25 )
7878
7979@export_subgroup ("Autoadvance" )
Original file line number Diff line number Diff line change @@ -15,12 +15,15 @@ extends Control
1515
1616## What animation should the indicator do.
1717@export_enum ('bounce' , 'blink' , 'none' ) var animation := 0
18+
19+ var texture_rect : TextureRect
20+
1821## Set the image to use as the indicator.
19- @export var texture := preload ("res://addons/dialogic/Example Assets/next-indicator/next-indicator.png" ):
22+ @export var texture : Texture2D = preload ("res://addons/dialogic/Example Assets/next-indicator/next-indicator.png" ) as Texture2D :
2023 set (_texture ):
2124 texture = _texture
22- if has_node ( 'Texture' ) :
23- get_node ( 'Texture' ) .texture = texture
25+ if texture_rect :
26+ texture_rect .texture = texture
2427
2528@export var texture_size := Vector2 (32 ,32 ):
2629 set (_texture_size ):
@@ -34,17 +37,20 @@ var tween: Tween
3437
3538func _ready ():
3639 add_to_group ('dialogic_next_indicator' )
37- # Creating texture
38- if texture :
40+
41+ # Creating TextureRect if missing
42+ if not texture_rect :
3943 var icon := TextureRect .new ()
4044 icon .name = 'Texture'
4145 icon .ignore_texture_size = true
4246 icon .stretch_mode = TextureRect .STRETCH_KEEP_ASPECT_CENTERED
4347 icon .size = texture_size
4448 icon .position = - icon .size
4549 add_child (icon )
46- icon .texture = texture
47-
50+ texture_rect = icon
51+
52+ texture_rect .texture = texture
53+
4854 hide ()
4955 visibility_changed .connect (_on_visibility_changed )
5056
You can’t perform that action at this time.
0 commit comments