mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-10-22 15:54:58 +00:00
Add icons for the text tool's options, and make horizontal alignment work
Note that due to limitations with the TextEdit node, horizontal alignment cannot be previewed until the text has been placed in the canvas. This will be fixed once https://github.com/godotengine/godot-proposals/issues/7352 is implemented. Icons made by @Erevoid.
This commit is contained in:
parent
a8c41312f8
commit
f91b55672a
22 changed files with 506 additions and 69 deletions
assets/graphics/tools
cursors
text.pngtext_options
allign_center.pngallign_center.png.importallign_fill.pngallign_fill.png.importallign_left.pngallign_left.png.importallign_right.pngallign_right.png.importantialiasing_grayscale.pngantialiasing_grayscale.png.importantialiasing_lcd.pngantialiasing_lcd.png.importantialiasing_off.pngantialiasing_off.png.importbold.pngbold.png.importitalic.pngitalic.png.import
src/Tools/UtilityTools
Binary file not shown.
Before ![]() (image error) Size: 218 B After ![]() (image error) Size: 180 B ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 246 B After ![]() (image error) Size: 163 B ![]() ![]() |
BIN
assets/graphics/tools/text_options/allign_center.png
Normal file
BIN
assets/graphics/tools/text_options/allign_center.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 136 B |
34
assets/graphics/tools/text_options/allign_center.png.import
Normal file
34
assets/graphics/tools/text_options/allign_center.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bw8cnv4x3bv76"
|
||||
path="res://.godot/imported/allign_center.png-997bdcaf093455c0488bc55429d2bd62.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/allign_center.png"
|
||||
dest_files=["res://.godot/imported/allign_center.png-997bdcaf093455c0488bc55429d2bd62.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/allign_fill.png
Normal file
BIN
assets/graphics/tools/text_options/allign_fill.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 126 B |
34
assets/graphics/tools/text_options/allign_fill.png.import
Normal file
34
assets/graphics/tools/text_options/allign_fill.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cb6op8ekb24jq"
|
||||
path="res://.godot/imported/allign_fill.png-9791b429c0d8e9e328a9d1549acd4f29.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/allign_fill.png"
|
||||
dest_files=["res://.godot/imported/allign_fill.png-9791b429c0d8e9e328a9d1549acd4f29.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/allign_left.png
Normal file
BIN
assets/graphics/tools/text_options/allign_left.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 135 B |
34
assets/graphics/tools/text_options/allign_left.png.import
Normal file
34
assets/graphics/tools/text_options/allign_left.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dvwgfoajkwkbt"
|
||||
path="res://.godot/imported/allign_left.png-7a3dee7ab825721445d69bbfe7ed3b6f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/allign_left.png"
|
||||
dest_files=["res://.godot/imported/allign_left.png-7a3dee7ab825721445d69bbfe7ed3b6f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/allign_right.png
Normal file
BIN
assets/graphics/tools/text_options/allign_right.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 133 B |
34
assets/graphics/tools/text_options/allign_right.png.import
Normal file
34
assets/graphics/tools/text_options/allign_right.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://crgq05c1i6p67"
|
||||
path="res://.godot/imported/allign_right.png-0f178439ce2624cdc338c3ebf507e30f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/allign_right.png"
|
||||
dest_files=["res://.godot/imported/allign_right.png-0f178439ce2624cdc338c3ebf507e30f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/antialiasing_grayscale.png
Normal file
BIN
assets/graphics/tools/text_options/antialiasing_grayscale.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 199 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dgkjy5utwxfs0"
|
||||
path="res://.godot/imported/antialiasing_grayscale.png-f3fee5777d46da7008986e88858dfd30.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/antialiasing_grayscale.png"
|
||||
dest_files=["res://.godot/imported/antialiasing_grayscale.png-f3fee5777d46da7008986e88858dfd30.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/antialiasing_lcd.png
Normal file
BIN
assets/graphics/tools/text_options/antialiasing_lcd.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 212 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dux65bi78pmu8"
|
||||
path="res://.godot/imported/antialiasing_lcd.png-b5995461bf6371ee97f9966b19d1fd42.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/antialiasing_lcd.png"
|
||||
dest_files=["res://.godot/imported/antialiasing_lcd.png-b5995461bf6371ee97f9966b19d1fd42.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/antialiasing_off.png
Normal file
BIN
assets/graphics/tools/text_options/antialiasing_off.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 226 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bu0lr6u0f7iva"
|
||||
path="res://.godot/imported/antialiasing_off.png-51ab2a25fdd4bf7af4da0c9ec99e0846.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/antialiasing_off.png"
|
||||
dest_files=["res://.godot/imported/antialiasing_off.png-51ab2a25fdd4bf7af4da0c9ec99e0846.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/bold.png
Normal file
BIN
assets/graphics/tools/text_options/bold.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 191 B |
34
assets/graphics/tools/text_options/bold.png.import
Normal file
34
assets/graphics/tools/text_options/bold.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dcs2c1qvc0a6c"
|
||||
path="res://.godot/imported/bold.png-9f104d93235546acd30785edaefaf7ce.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/bold.png"
|
||||
dest_files=["res://.godot/imported/bold.png-9f104d93235546acd30785edaefaf7ce.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/tools/text_options/italic.png
Normal file
BIN
assets/graphics/tools/text_options/italic.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 169 B |
34
assets/graphics/tools/text_options/italic.png.import
Normal file
34
assets/graphics/tools/text_options/italic.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b4paoyuodyjet"
|
||||
path="res://.godot/imported/italic.png-e16f3f1c8f6ef813af88c239044157a0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/tools/text_options/italic.png"
|
||||
dest_files=["res://.godot/imported/italic.png-e16f3f1c8f6ef813af88c239044157a0.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
|
@ -1,7 +1,7 @@
|
|||
extends BaseTool
|
||||
|
||||
enum TextStyle { REGULAR, BOLD, ITALIC, BOLD_ITALIC }
|
||||
|
||||
const BOLD_FLAG := 1
|
||||
const ITALIC_FLAG := 2
|
||||
const EMBOLDEN_AMOUNT := 0.6
|
||||
const ITALIC_AMOUNT := 0.2
|
||||
const ITALIC_TRANSFORM := Transform2D(Vector2(1.0, ITALIC_AMOUNT), Vector2(0.0, 1.0), Vector2.ZERO)
|
||||
|
@ -19,22 +19,11 @@ var font_name := "":
|
|||
font.base_font = Global.find_font_from_name(font_name)
|
||||
font.base_font.antialiasing = antialiasing
|
||||
_textedit_text_changed()
|
||||
var text_style := TextStyle.REGULAR:
|
||||
var text_style := 0:
|
||||
set(value):
|
||||
text_style = value
|
||||
match text_style:
|
||||
TextStyle.REGULAR:
|
||||
font.variation_embolden = 0
|
||||
font.variation_transform = Transform2D()
|
||||
TextStyle.BOLD:
|
||||
font.variation_embolden = EMBOLDEN_AMOUNT
|
||||
font.variation_transform = Transform2D()
|
||||
TextStyle.ITALIC:
|
||||
font.variation_embolden = 0
|
||||
font.variation_transform = ITALIC_TRANSFORM
|
||||
TextStyle.BOLD_ITALIC:
|
||||
font.variation_embolden = EMBOLDEN_AMOUNT
|
||||
font.variation_transform = ITALIC_TRANSFORM
|
||||
font.variation_embolden = EMBOLDEN_AMOUNT if text_style & BOLD_FLAG else 0.0
|
||||
font.variation_transform = ITALIC_TRANSFORM if text_style & ITALIC_FLAG else Transform2D()
|
||||
save_config()
|
||||
_textedit_text_changed()
|
||||
|
||||
|
@ -48,6 +37,8 @@ var _offset := Vector2i.ZERO
|
|||
|
||||
@onready var confirm_buttons: HBoxContainer = $ConfirmButtons
|
||||
@onready var font_option_button: OptionButton = $GridContainer/FontOptionButton
|
||||
@onready var horizontal_alignment_group: ButtonGroup = %HorizontalAlignmentLeftButton.button_group
|
||||
@onready var anti_aliasing_group: ButtonGroup = %AAOffButton.button_group
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
@ -55,6 +46,8 @@ func _ready() -> void:
|
|||
for f_name in font_names:
|
||||
font_option_button.add_item(f_name)
|
||||
Tools.color_changed.connect(_on_color_changed)
|
||||
horizontal_alignment_group.pressed.connect(_on_horizontal_alignment_button_pressed)
|
||||
anti_aliasing_group.pressed.connect(_on_antialiasing_button_pressed)
|
||||
super._ready()
|
||||
|
||||
|
||||
|
@ -141,7 +134,9 @@ func text_to_pixels() -> void:
|
|||
var font_ascent := font.get_ascent(text_size)
|
||||
var pos := Vector2(0, font_ascent + text_edit.get_theme_constant(&"line_spacing"))
|
||||
pos += text_edit.position
|
||||
font.draw_multiline_string(ci_rid, pos, text, horizontal_alignment, -1, text_size, -1, color)
|
||||
font.draw_multiline_string(
|
||||
ci_rid, pos, text, horizontal_alignment, text_edit.size.x, text_size, -1, color
|
||||
)
|
||||
|
||||
RenderingServer.viewport_set_update_mode(vp, RenderingServer.VIEWPORT_UPDATE_ONCE)
|
||||
RenderingServer.force_draw(false)
|
||||
|
@ -221,16 +216,28 @@ func _on_font_option_button_item_selected(index: int) -> void:
|
|||
save_config()
|
||||
|
||||
|
||||
func _on_style_option_button_item_selected(index: TextStyle) -> void:
|
||||
text_style = index
|
||||
func _on_bold_button_toggled(toggled_on: bool) -> void:
|
||||
if toggled_on:
|
||||
text_style |= BOLD_FLAG
|
||||
else:
|
||||
text_style &= ~BOLD_FLAG
|
||||
|
||||
|
||||
func _on_horizontal_alignment_option_button_item_selected(index: HorizontalAlignment) -> void:
|
||||
horizontal_alignment = index
|
||||
func _on_italic_button_toggled(toggled_on: bool) -> void:
|
||||
if toggled_on:
|
||||
text_style |= ITALIC_FLAG
|
||||
else:
|
||||
text_style &= ~ITALIC_FLAG
|
||||
|
||||
|
||||
func _on_antialiasing_option_button_item_selected(index: TextServer.FontAntialiasing) -> void:
|
||||
antialiasing = index
|
||||
func _on_horizontal_alignment_button_pressed(button: BaseButton) -> void:
|
||||
@warning_ignore("int_as_enum_without_cast")
|
||||
horizontal_alignment = button.get_index()
|
||||
|
||||
|
||||
func _on_antialiasing_button_pressed(button: BaseButton) -> void:
|
||||
@warning_ignore("int_as_enum_without_cast")
|
||||
antialiasing = button.get_index()
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
|
|
|
@ -1,13 +1,27 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://bdregpkflev7u"]
|
||||
[gd_scene load_steps=17 format=3 uid="uid://bdregpkflev7u"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ctfgfelg0sho8" path="res://src/Tools/BaseTool.tscn" id="1_1q6ub"]
|
||||
[ext_resource type="Script" path="res://src/Tools/UtilityTools/Text.gd" id="2_ql5g6"]
|
||||
[ext_resource type="Texture2D" uid="uid://d267xalp3p7ru" path="res://assets/graphics/misc/check_plain.png" id="3_novww"]
|
||||
[ext_resource type="Script" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="3_tidsq"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnc78807k1xjv" path="res://assets/graphics/misc/close.png" id="4_nhcnn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcs2c1qvc0a6c" path="res://assets/graphics/tools/text_options/bold.png" id="6_44cpf"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4paoyuodyjet" path="res://assets/graphics/tools/text_options/italic.png" id="7_vnai6"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvwgfoajkwkbt" path="res://assets/graphics/tools/text_options/allign_left.png" id="8_krqdj"]
|
||||
[ext_resource type="Texture2D" uid="uid://bw8cnv4x3bv76" path="res://assets/graphics/tools/text_options/allign_center.png" id="9_icae5"]
|
||||
[ext_resource type="Texture2D" uid="uid://crgq05c1i6p67" path="res://assets/graphics/tools/text_options/allign_right.png" id="10_s8jkt"]
|
||||
[ext_resource type="Texture2D" uid="uid://cb6op8ekb24jq" path="res://assets/graphics/tools/text_options/allign_fill.png" id="11_wdbj6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bu0lr6u0f7iva" path="res://assets/graphics/tools/text_options/antialiasing_off.png" id="12_25fng"]
|
||||
[ext_resource type="Texture2D" uid="uid://dgkjy5utwxfs0" path="res://assets/graphics/tools/text_options/antialiasing_grayscale.png" id="13_y175e"]
|
||||
[ext_resource type="Texture2D" uid="uid://dux65bi78pmu8" path="res://assets/graphics/tools/text_options/antialiasing_lcd.png" id="14_s8hba"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_ikyyu"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_jplns"]
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource("1_1q6ub")]
|
||||
script = ExtResource("2_ql5g6")
|
||||
metadata/_edit_vertical_guides_ = [-9.0]
|
||||
|
||||
[node name="ConfirmButtons" type="HBoxContainer" parent="." index="2"]
|
||||
visible = false
|
||||
|
@ -81,63 +95,173 @@ size_flags_horizontal = 3
|
|||
mouse_default_cursor_shape = 2
|
||||
fit_to_longest_item = false
|
||||
|
||||
[node name="StyleLabel" type="Label" parent="GridContainer" index="2"]
|
||||
[node name="StyleButtonContainer" type="HBoxContainer" parent="." index="5"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Style:"
|
||||
|
||||
[node name="StyleOptionButton" type="OptionButton" parent="GridContainer" index="3"]
|
||||
[node name="BoldButton" type="Button" parent="StyleButtonContainer" index="0" groups=["UIButtons"]]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_default_cursor_shape = 2
|
||||
selected = 0
|
||||
item_count = 4
|
||||
popup/item_0/text = "Regular"
|
||||
popup/item_1/text = "Bold"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Italic"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "Bold Italic"
|
||||
popup/item_3/id = 3
|
||||
toggle_mode = true
|
||||
|
||||
[node name="HorizontalAlignmentLabel" type="Label" parent="GridContainer" index="4"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Horizontal alignment:"
|
||||
[node name="TextureRect" type="TextureRect" parent="StyleButtonContainer/BoldButton" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("6_44cpf")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="HorizontalAlignmentOptionButton" type="OptionButton" parent="GridContainer" index="5"]
|
||||
visible = false
|
||||
[node name="ItalicButton" type="Button" parent="StyleButtonContainer" index="1" groups=["UIButtons"]]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
selected = 0
|
||||
item_count = 4
|
||||
popup/item_0/text = "Left"
|
||||
popup/item_1/text = "Center"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Right"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "Fill"
|
||||
popup/item_3/id = 3
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
|
||||
[node name="AntialiasingLabel" type="Label" parent="GridContainer" index="6"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Antialiasing:"
|
||||
[node name="TextureRect" type="TextureRect" parent="StyleButtonContainer/ItalicButton" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("7_vnai6")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="AntialiasingOptionButton" type="OptionButton" parent="GridContainer" index="7"]
|
||||
[node name="HorizontalAlignmentContainer" type="HBoxContainer" parent="." index="6"]
|
||||
layout_mode = 2
|
||||
selected = 0
|
||||
item_count = 3
|
||||
popup/item_0/text = "None"
|
||||
popup/item_1/text = "Grayscale"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "LCD"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="HorizontalAlignmentLeftButton" type="Button" parent="HorizontalAlignmentContainer" index="0" groups=["UIButtons"]]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
button_pressed = true
|
||||
button_group = SubResource("ButtonGroup_ikyyu")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HorizontalAlignmentContainer/HorizontalAlignmentLeftButton" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("8_krqdj")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="HorizontalAlignmentLeftButton2" type="Button" parent="HorizontalAlignmentContainer" index="1" groups=["UIButtons"]]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
button_group = SubResource("ButtonGroup_ikyyu")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HorizontalAlignmentContainer/HorizontalAlignmentLeftButton2" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("9_icae5")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="HorizontalAlignmentLeftButton3" type="Button" parent="HorizontalAlignmentContainer" index="2" groups=["UIButtons"]]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
button_group = SubResource("ButtonGroup_ikyyu")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HorizontalAlignmentContainer/HorizontalAlignmentLeftButton3" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("10_s8jkt")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="HorizontalAlignmentLeftButton4" type="Button" parent="HorizontalAlignmentContainer" index="3" groups=["UIButtons"]]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
button_group = SubResource("ButtonGroup_ikyyu")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HorizontalAlignmentContainer/HorizontalAlignmentLeftButton4" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("11_wdbj6")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="AntiAliasingButtonContainer" type="HBoxContainer" parent="." index="7"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AAOffButton" type="Button" parent="AntiAliasingButtonContainer" index="0" groups=["UIButtons"]]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
button_pressed = true
|
||||
button_group = SubResource("ButtonGroup_jplns")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="AntiAliasingButtonContainer/AAOffButton" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("12_25fng")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="AAGrayscaleButton" type="Button" parent="AntiAliasingButtonContainer" index="1" groups=["UIButtons"]]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
button_group = SubResource("ButtonGroup_jplns")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="AntiAliasingButtonContainer/AAGrayscaleButton" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("13_y175e")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="AALCDButton" type="Button" parent="AntiAliasingButtonContainer" index="2" groups=["UIButtons"]]
|
||||
custom_minimum_size = Vector2(24, 24)
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
toggle_mode = true
|
||||
button_group = SubResource("ButtonGroup_jplns")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="AntiAliasingButtonContainer/AALCDButton" index="0"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("14_s8hba")
|
||||
stretch_mode = 3
|
||||
|
||||
[connection signal="pressed" from="ConfirmButtons/ConfirmButton" to="." method="_on_confirm_button_pressed"]
|
||||
[connection signal="pressed" from="ConfirmButtons/CancelButton" to="." method="_on_cancel_button_pressed"]
|
||||
[connection signal="value_changed" from="TextSizeSlider" to="." method="_on_text_size_slider_value_changed"]
|
||||
[connection signal="item_selected" from="GridContainer/FontOptionButton" to="." method="_on_font_option_button_item_selected"]
|
||||
[connection signal="item_selected" from="GridContainer/StyleOptionButton" to="." method="_on_style_option_button_item_selected"]
|
||||
[connection signal="item_selected" from="GridContainer/HorizontalAlignmentOptionButton" to="." method="_on_horizontal_alignment_option_button_item_selected"]
|
||||
[connection signal="item_selected" from="GridContainer/AntialiasingOptionButton" to="." method="_on_antialiasing_option_button_item_selected"]
|
||||
[connection signal="toggled" from="StyleButtonContainer/BoldButton" to="." method="_on_bold_button_toggled"]
|
||||
[connection signal="toggled" from="StyleButtonContainer/ItalicButton" to="." method="_on_italic_button_toggled"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue