-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
custom theme and font with damage text
creating custom theme resource and project wide theme usage using tween effects for floating damage text scene effect on hurtbox component with dynamic text based on hitbox damage dealt on enemy
- Loading branch information
1 parent
a14135d
commit 54c3143
Showing
8 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
38 changes: 38 additions & 0 deletions
38
2d-survivors-course/resources/theme/Rockboxcond12.ttf.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[remap] | ||
|
||
importer="font_data_dynamic" | ||
type="FontFile" | ||
uid="uid://b7708ebmlmygw" | ||
path="res://.godot/imported/Rockboxcond12.ttf-6ec46e755c0cb4bc7bf74c19c1d5cac8.fontdata" | ||
|
||
[deps] | ||
|
||
source_file="res://resources/theme/Rockboxcond12.ttf" | ||
dest_files=["res://.godot/imported/Rockboxcond12.ttf-6ec46e755c0cb4bc7bf74c19c1d5cac8.fontdata"] | ||
|
||
[params] | ||
|
||
Rendering=null | ||
antialiasing=0 | ||
generate_mipmaps=false | ||
multichannel_signed_distance_field=false | ||
msdf_pixel_range=8 | ||
msdf_size=48 | ||
allow_system_fallback=true | ||
force_autohinter=false | ||
hinting=0 | ||
subpixel_positioning=0 | ||
oversampling=0.0 | ||
Fallbacks=null | ||
fallbacks=[] | ||
Compress=null | ||
compress=true | ||
preload=[{ | ||
"chars": [], | ||
"glyphs": [], | ||
"name": "New Configuration", | ||
"size": Vector2i(16, 0) | ||
}] | ||
language_support={} | ||
script_support={} | ||
opentype_features={} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://dppehnirbmmb0"] | ||
|
||
[ext_resource type="FontFile" uid="uid://b7708ebmlmygw" path="res://resources/theme/Rockboxcond12.ttf" id="1_8cegc"] | ||
|
||
[resource] | ||
default_font = ExtResource("1_8cegc") | ||
default_font_size = 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
extends Node2D | ||
class_name FloatingText | ||
|
||
func _ready(): | ||
pass | ||
|
||
|
||
func start(text: String): | ||
$Label.text = text | ||
|
||
var tween = create_tween() | ||
tween.set_parallel() | ||
|
||
tween.tween_property(self, "global_position", global_position + (Vector2.UP * 16), .3)\ | ||
.set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC) | ||
tween.chain() | ||
|
||
tween.tween_property(self, "global_position", global_position + (Vector2.UP * 16), .5)\ | ||
.set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_CUBIC) | ||
tween.tween_property(self, "scale", Vector2.ONE, .5).set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_CUBIC) | ||
tween.chain() | ||
|
||
tween.tween_callback(queue_free) | ||
|
||
var scale_tween = create_tween() | ||
scale_tween.tween_property(self, "scale", Vector2.ONE * 1.5, .15).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC) | ||
scale_tween.tween_property(self, "scale", Vector2.ONE, .15).set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_CUBIC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://l5bn3rnkbcgi"] | ||
|
||
[ext_resource type="Script" path="res://scenes/ui/floating_text.gd" id="1_ets41"] | ||
|
||
[node name="FloatingText" type="Node2D"] | ||
script = ExtResource("1_ets41") | ||
|
||
[node name="Label" type="Label" parent="."] | ||
custom_minimum_size = Vector2(100, 32) | ||
offset_left = -50.0 | ||
offset_top = -14.0 | ||
offset_right = 50.0 | ||
offset_bottom = 18.0 | ||
theme_override_colors/font_shadow_color = Color(0.247059, 0.14902, 0.192157, 1) | ||
theme_override_colors/font_outline_color = Color(0.247059, 0.14902, 0.192157, 1) | ||
theme_override_constants/shadow_offset_x = 0 | ||
theme_override_constants/shadow_offset_y = 0 | ||
theme_override_constants/outline_size = 6 | ||
text = "108" | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 |