mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-21 23:18:11 +00:00
changing text label colour
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://o3ya33lcbn7y"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b5jrj8u7cx8id" path="res://Scripts/Parts/TilePropertyValue.gd" id="1_q3buy"]
|
||||
|
||||
[sub_resource type="FontFile" id="FontFile_wb64e"]
|
||||
cache/0/16/0/ascent = 0.0
|
||||
cache/0/16/0/descent = 0.0
|
||||
cache/0/16/0/underline_position = 0.0
|
||||
cache/0/16/0/underline_thickness = 0.0
|
||||
cache/0/16/0/scale = 1.0
|
||||
|
||||
[sub_resource type="Theme" id="Theme_itros"]
|
||||
default_font = SubResource("FontFile_wb64e")
|
||||
|
||||
[node name="TilePropertyColour" type="HBoxContainer"]
|
||||
script = ExtResource("1_q3buy")
|
||||
tile_property_name = "colour"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "PROPERTY_NAME:"
|
||||
uppercase = true
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
layer = 2
|
||||
visible = false
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0.69803923)
|
||||
|
||||
[node name="ColorPicker" type="ColorPicker" parent="CanvasLayer"]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -85.0
|
||||
offset_top = -81.5
|
||||
offset_right = 85.0
|
||||
offset_bottom = 81.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = SubResource("Theme_itros")
|
||||
theme_override_constants/sv_width = 128
|
||||
theme_override_constants/sv_height = 128
|
||||
sampler_visible = false
|
||||
color_modes_visible = false
|
||||
sliders_visible = false
|
||||
presets_visible = false
|
||||
|
||||
[node name="Button" type="Button" parent="CanvasLayer/ColorPicker"]
|
||||
layout_mode = 2
|
||||
text = "CLOSE"
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
custom_minimum_size = Vector2(64, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button" type="Button" parent="ColorRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
flat = true
|
||||
|
||||
[connection signal="start_value_changed" from="." to="ColorRect" method="set_color"]
|
||||
[connection signal="color_changed" from="CanvasLayer/ColorPicker" to="." method="set_value"]
|
||||
[connection signal="color_changed" from="CanvasLayer/ColorPicker" to="ColorRect" method="set_color"]
|
||||
[connection signal="pressed" from="CanvasLayer/ColorPicker/Button" to="CanvasLayer" method="hide"]
|
||||
[connection signal="pressed" from="ColorRect/Button" to="CanvasLayer" method="show"]
|
@@ -9,6 +9,9 @@
|
||||
color = Color(1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="FontFile" id="FontFile_yptip"]
|
||||
subpixel_positioning = 0
|
||||
msdf_pixel_range = 14
|
||||
msdf_size = 128
|
||||
cache/0/16/0/ascent = 0.0
|
||||
cache/0/16/0/descent = 0.0
|
||||
cache/0/16/0/underline_position = 0.0
|
||||
@@ -84,7 +87,6 @@ uppercase = true
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "aadadadawsdad"
|
||||
text_overrun_behavior = 3
|
||||
uppercase = true
|
||||
|
||||
|
@@ -10,8 +10,13 @@ script/source = "extends Node2D
|
||||
|
||||
@export var text := \"\"
|
||||
|
||||
@export_enum(\"Left\", \"Center\", \"Right\") var text_alignment := 0
|
||||
@export var colour := Color.WHITE
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
$TextLabel.text = text
|
||||
$TextLabel.horizontal_alignment = text_alignment
|
||||
$TextLabel.add_theme_color_override(\"font_color\", colour)
|
||||
"
|
||||
|
||||
[node name="TextLabelOBJ" type="Node2D"]
|
||||
@@ -26,7 +31,7 @@ offset_bottom = 8.0
|
||||
|
||||
[node name="EditorPropertyExposer" type="Node" parent="."]
|
||||
script = ExtResource("2_xh6kd")
|
||||
properties = Array[String](["text"])
|
||||
properties = Array[String](["text", "text_alignment", "colour"])
|
||||
metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"
|
||||
|
||||
[node name="LevelEditorVisibleNode" type="Node2D" parent="."]
|
||||
|
@@ -44,13 +44,12 @@ metadata/_edit_use_anchors_ = true
|
||||
unique_name_in_owner = true
|
||||
material = SubResource("CanvasItemMaterial_qar1j")
|
||||
position = Vector2(-64, 0)
|
||||
emitting = false
|
||||
amount = 64
|
||||
texture = ExtResource("1_0tjo2")
|
||||
lifetime = 2.0
|
||||
draw_order = 1
|
||||
emission_shape = 3
|
||||
emission_rect_extents = Vector2(1, 8)
|
||||
emission_rect_extents = Vector2(1, 128)
|
||||
spread = 0.0
|
||||
gravity = Vector2(0, 0)
|
||||
initial_velocity_min = 100.0
|
||||
@@ -61,7 +60,7 @@ anim_offset_max = 1.0
|
||||
|
||||
[node name="ResourceSetterNew" type="Node" parent="CanvasLayer/Control/Particles" node_paths=PackedStringArray("node_to_affect")]
|
||||
script = ExtResource("3_sbjyn")
|
||||
node_to_affect = NodePath("")
|
||||
node_to_affect = NodePath("..")
|
||||
property_name = "texture"
|
||||
mode = 1
|
||||
resource_json = ExtResource("4_qvx5e")
|
||||
|
@@ -7,7 +7,6 @@ func open_menu() -> void:
|
||||
editing_start.emit()
|
||||
$CanvasLayer.show()
|
||||
|
||||
|
||||
func on_pressed() -> void:
|
||||
set_value(Global.sanitize_string($CanvasLayer/Panel/VBoxContainer/TextEdit.text))
|
||||
editing_finished.emit()
|
||||
|
@@ -69,7 +69,8 @@ func add_properties() -> void:
|
||||
property.property_step = float(values[2])
|
||||
elif i.type == TYPE_BOOL:
|
||||
property = preload("uid://diqn7e5hqpbsk").instantiate()
|
||||
|
||||
elif i.type == TYPE_COLOR:
|
||||
property = preload("uid://o3ya33lcbn7y").instantiate()
|
||||
|
||||
if property != null:
|
||||
property.exit_changed.connect(set_can_exit)
|
||||
|
Reference in New Issue
Block a user