initial commit
This commit is contained in:
commit
e446938ba7
74 changed files with 3212 additions and 0 deletions
19
TextCollision.gd
Normal file
19
TextCollision.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends CollisionShape2D
|
||||
|
||||
@onready var font: Font = $"../Label".get_theme_font("font")
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
update_size()
|
||||
|
||||
func update_size():
|
||||
var bbox = font.get_string_size($"../Label".text, HORIZONTAL_ALIGNMENT_LEFT, -1, $"../Label".get_theme_font_size("font_size"))
|
||||
#print(bbox)
|
||||
bbox.y /= 2.2
|
||||
bbox.x -= 20
|
||||
get_shape().extents = bbox / 2
|
||||
#print(bbox)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
update_size()
|
Loading…
Add table
Add a link
Reference in a new issue