Getting started heregit status!
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||||
<g transform="matrix(0.785928,0,0,0.796326,1.23126,1.65589)">
|
||||
<path d="M8,0L0,0L0,16L16,16L16,8" style="fill:none;stroke:rgb(224,224,224);stroke-width:2.63px;"/>
|
||||
</g>
|
||||
<g transform="matrix(0.97399,0.0268552,0.0268552,0.972272,-0.215329,0.222325)">
|
||||
<path d="M4.893,11.105L14.919,1.062" style="fill:none;stroke:rgb(224,224,224);stroke-width:2.08px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1.49932,0,0,1.58615,-6.13491,-1.95252)">
|
||||
<path d="M14.763,4.334C14.763,4.49 14.664,4.631 14.511,4.691C14.358,4.751 14.181,4.718 14.064,4.607C13.271,3.858 11.985,2.642 11.191,1.892C11.074,1.781 11.039,1.615 11.103,1.47C11.166,1.325 11.315,1.231 11.481,1.231C12.391,1.231 13.698,1.231 14.354,1.231C14.58,1.231 14.763,1.404 14.763,1.618C14.763,2.238 14.763,3.473 14.763,4.334Z" style="fill:rgb(224,224,224);"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/ExternalLink.svg-68da2553f64c9b2f7a0ae4a9502e3475.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/texture_fonts/Assets/ExternalLink.svg"
|
||||
dest_files=[ "res://.import/ExternalLink.svg-68da2553f64c9b2f7a0ae4a9502e3475.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><g transform="matrix(1.14286,0,0,1.11731,-1.14286,-1.11731)"><path d="M15,1.895C15,1.401 14.608,1 14.125,1L1.875,1C1.392,1 1,1.401 1,1.895L1,14.425C1,14.919 1.392,15.32 1.875,15.32L14.125,15.32C14.608,15.32 15,14.919 15,14.425L15,1.895ZM13.25,2.79L13.25,11.74C13.25,11.74 2.75,11.74 2.75,11.74C2.75,11.74 2.75,2.79 2.75,2.79L13.25,2.79Z" style="fill:rgb(224,224,224);"/></g><g transform="matrix(0.6257,0,0,0.6257,3.62158,1.67975)"><path d="M4.122,15.761L4.122,13.668L4.123,13.668C4.504,13.668 4.87,13.517 5.139,13.247C5.409,12.978 5.56,12.612 5.56,12.231C5.56,9.364 5.56,3.205 5.56,3.205L4.409,3.205C3.986,3.205 3.579,3.373 3.28,3.673C2.981,3.972 2.812,4.378 2.812,4.802C2.812,5.088 2.812,5.298 2.812,5.298L0.959,5.298L0.959,1.112L13.036,1.112L13.036,5.298L11.183,5.298L11.183,4.802C11.183,4.378 11.015,3.972 10.715,3.673C10.416,3.373 10.01,3.205 9.586,3.205C8.981,3.205 8.435,3.205 8.435,3.205L8.435,12.231C8.435,12.612 8.587,12.978 8.856,13.247C9.126,13.517 9.491,13.668 9.872,13.668C9.873,13.668 9.873,13.668 9.873,13.668L9.873,15.761L4.122,15.761Z" style="fill:rgb(224,224,224);fill-rule:nonzero;"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/TextureFont.svg-adef2debb7c79848948a2b7635388fbc.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/texture_fonts/Assets/TextureFont.svg"
|
||||
dest_files=[ "res://.import/TextureFont.svg-adef2debb7c79848948a2b7635388fbc.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/TransparentBG.png-3af58a3dff736086211bd6d5a3d9251d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/texture_fonts/Assets/TransparentBG.png"
|
||||
dest_files=[ "res://.import/TransparentBG.png-3af58a3dff736086211bd6d5a3d9251d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/TransparentBG_small.png-831547cc9a7eea4c3d8547ee68a417be.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/texture_fonts/Assets/TransparentBG_small.png"
|
||||
dest_files=[ "res://.import/TransparentBG_small.png-831547cc9a7eea4c3d8547ee68a417be.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,147 @@
|
||||
tool
|
||||
extends BitmapFont
|
||||
class_name TextureFont, "res://addons/texture_fonts/Assets/TextureFont.svg"
|
||||
|
||||
|
||||
var _texture_mappings: Array
|
||||
var _font_settings
|
||||
|
||||
|
||||
const default_texture_mappings := {
|
||||
rect_size = Vector2(14, 14),
|
||||
rect_gap = Vector2(1, 1),
|
||||
texture_offset = Vector2(1, 1),
|
||||
chars = \
|
||||
"""abcdefgh
|
||||
ijklmnop
|
||||
qrstuvwx
|
||||
yz.,!?" """
|
||||
}
|
||||
|
||||
func _init():
|
||||
_font_settings = load("res://addons/texture_fonts/Classes/TextureFontSettings.gd").new()
|
||||
|
||||
|
||||
func get_class():
|
||||
return "TextureFont"
|
||||
|
||||
func add_texture(texture: Texture) -> void:
|
||||
.add_texture(texture)
|
||||
var mapping = load("res://addons/texture_fonts/Classes/TextureFontMapping.gd").new()
|
||||
mapping.set_texture(texture)
|
||||
mapping.rect_size = default_texture_mappings.rect_size
|
||||
mapping.rect_gap = default_texture_mappings.rect_gap
|
||||
mapping.texture_offset = default_texture_mappings.texture_offset
|
||||
mapping.chars = default_texture_mappings.chars
|
||||
|
||||
self.texture_mappings.append(mapping)
|
||||
|
||||
|
||||
func remove_texture(index: int) -> void:
|
||||
self.texture_mappings.remove(index)
|
||||
|
||||
|
||||
func build_font():
|
||||
var height = self.height
|
||||
var ascent = self.ascent
|
||||
var distance_field = self.distance_field
|
||||
var fallback = self.fallback
|
||||
|
||||
.clear()
|
||||
|
||||
var mono: bool = self.font_settings.monospace
|
||||
var h_align: int = self.font_settings.horizontal_align
|
||||
var v_align: int = self.font_settings.vertical_align
|
||||
var gap: int = self.font_settings.gap
|
||||
|
||||
var is_space_defined := false
|
||||
|
||||
for i in _texture_mappings.size():
|
||||
var mapping = _texture_mappings[i]
|
||||
.add_texture(mapping.scaled_texture)
|
||||
|
||||
var char_codes = mapping.char_codes
|
||||
|
||||
for line in char_codes:
|
||||
for code in line:
|
||||
if code == 32:
|
||||
is_space_defined = true
|
||||
|
||||
var rect
|
||||
|
||||
if mono:
|
||||
rect = mapping.get_char_rect(code)
|
||||
else:
|
||||
rect = mapping.get_cropped_char_rect(code)
|
||||
|
||||
if rect == null:
|
||||
continue
|
||||
|
||||
var char_setting = _font_settings.get_setting(code)
|
||||
var align = char_setting.offset
|
||||
var advance = rect.size.x + char_setting.advance + gap
|
||||
|
||||
align.x += h_align
|
||||
align.y += v_align
|
||||
|
||||
add_char(code, i, rect, align, advance)
|
||||
|
||||
# add empty space char
|
||||
if not is_space_defined and not fallback and _texture_mappings.size() > 0:
|
||||
var char_setting = _font_settings.get_setting(32)
|
||||
|
||||
var extra_space := 0
|
||||
if mono:
|
||||
extra_space = _texture_mappings[0].rect_size.x * _texture_mappings[0].scale
|
||||
|
||||
var advance = char_setting.advance + extra_space + gap
|
||||
|
||||
var rect := Rect2(0,0,0,0)
|
||||
add_char(32, 0, rect, Vector2.ZERO, advance)
|
||||
|
||||
self.height = height
|
||||
self.ascent = ascent
|
||||
self.distance_field = distance_field
|
||||
self.fallback = fallback
|
||||
|
||||
var kerning_pairs = _font_settings.solve_kerning_pairs()
|
||||
|
||||
for pair in kerning_pairs:
|
||||
add_kerning_pair(pair.char_a, pair.char_b, pair.kerning)
|
||||
|
||||
emit_signal("changed")
|
||||
|
||||
|
||||
func _get_property_list():
|
||||
|
||||
var props = [
|
||||
{
|
||||
name = "texture_mappings",
|
||||
usage = PROPERTY_USAGE_NOEDITOR,
|
||||
type = TYPE_RAW_ARRAY
|
||||
},
|
||||
{
|
||||
name = "font_settings",
|
||||
usage = PROPERTY_USAGE_NOEDITOR,
|
||||
type = TYPE_NIL
|
||||
}
|
||||
]
|
||||
|
||||
return props
|
||||
|
||||
|
||||
func _get(property: String):
|
||||
match property:
|
||||
"texture_mappings":
|
||||
return _texture_mappings
|
||||
"font_settings":
|
||||
return _font_settings
|
||||
|
||||
|
||||
func _set(property: String, val):
|
||||
match property:
|
||||
"texture_mappings":
|
||||
_texture_mappings = val
|
||||
"font_settings":
|
||||
_font_settings = val
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
tool
|
||||
extends Resource
|
||||
|
||||
var char_utils := preload("../Util/CharUtils.gd").new()
|
||||
|
||||
export var source_texture: Texture
|
||||
export var scaled_texture: Texture
|
||||
|
||||
func set_texture(new_texture):
|
||||
source_texture = new_texture
|
||||
scaled_texture = get_scaled_texture()
|
||||
func get_texture():
|
||||
return scaled_texture
|
||||
|
||||
|
||||
export var rect_size: Vector2
|
||||
export var rect_gap: Vector2
|
||||
export var texture_offset: Vector2
|
||||
export var scale := 1 setget set_scale, get_scale
|
||||
func set_scale(new_scale):
|
||||
scale = new_scale
|
||||
scaled_texture = get_scaled_texture()
|
||||
func get_scale():
|
||||
return scale
|
||||
|
||||
export var interpolation := Image.INTERPOLATE_NEAREST setget set_interpolation, get_interpolation
|
||||
func set_interpolation(new_in):
|
||||
interpolation = new_in
|
||||
scaled_texture = get_scaled_texture()
|
||||
func get_interpolation():
|
||||
return interpolation
|
||||
|
||||
export var chars: String setget set_chars, get_chars
|
||||
func set_chars(new_chars):
|
||||
chars = new_chars
|
||||
char_codes = char_utils.chars_to_codes(new_chars)
|
||||
func get_chars():
|
||||
return chars
|
||||
|
||||
# 2d Array containing int char codes
|
||||
var char_codes: Array
|
||||
|
||||
|
||||
func get_scaled_texture() -> Texture:
|
||||
if scale == 1:
|
||||
return source_texture
|
||||
|
||||
var size := source_texture.get_size()
|
||||
var flags := source_texture.flags
|
||||
|
||||
var scaled = size * scale
|
||||
|
||||
if scaled.x > 16384 or scaled.y > 16384:
|
||||
push_error("Could not Upscale Texture! Texture too large")
|
||||
return source_texture
|
||||
|
||||
var img := source_texture.get_data()
|
||||
img.resize(scaled.x, scaled.y, interpolation)
|
||||
var tex = ImageTexture.new()
|
||||
tex.create_from_image(img, flags)
|
||||
|
||||
return tex
|
||||
|
||||
|
||||
func get_char_width(char_code: int) -> int:
|
||||
if char_codes.find(char_code) == -1:
|
||||
return -1
|
||||
|
||||
var rect = get_char_rect(char_code)
|
||||
return rect.size.x
|
||||
|
||||
|
||||
func get_char_pos(char_code: int):
|
||||
for i in char_codes.size():
|
||||
var line = char_codes[i]
|
||||
var pos = line.find(char_code)
|
||||
if pos == -1:
|
||||
continue
|
||||
else:
|
||||
return Vector2(pos, i)
|
||||
|
||||
return null
|
||||
|
||||
|
||||
func _get_char_rect_unscaled(char_code: int):
|
||||
var pos: Vector2 = get_char_pos(char_code)
|
||||
if pos == null:
|
||||
return null
|
||||
|
||||
var rect := Rect2(
|
||||
(rect_size + rect_gap) * pos + texture_offset,
|
||||
rect_size
|
||||
)
|
||||
|
||||
var texture_size := source_texture.get_size()
|
||||
if rect.end.x > texture_size.x or rect.end.y > texture_size.y:
|
||||
return null
|
||||
|
||||
return rect
|
||||
|
||||
|
||||
func get_char_rect(char_code: int):
|
||||
var rect = _get_char_rect_unscaled(char_code)
|
||||
if rect == null:
|
||||
return null
|
||||
|
||||
rect.position *= scale
|
||||
rect.size *= scale
|
||||
|
||||
return rect
|
||||
|
||||
|
||||
func get_cropped_char_rect(char_code: int):
|
||||
var rect = _get_char_rect_unscaled(char_code)
|
||||
if rect == null:
|
||||
return null
|
||||
|
||||
var empty_left := _scan_empty_pixels(
|
||||
rect.position.x, rect.position.x + rect.size.x,
|
||||
rect.position.y, rect.position.y + rect.size.y)
|
||||
|
||||
rect.position.x += empty_left
|
||||
rect.size.x -= empty_left
|
||||
|
||||
if rect.size.x == 0:
|
||||
return rect
|
||||
|
||||
var empty_right := _scan_empty_pixels(
|
||||
rect.position.x + rect.size.x - 1, rect.position.x - 1,
|
||||
rect.position.y, rect.position.y + rect.size.y)
|
||||
|
||||
rect.size.x -= empty_right
|
||||
|
||||
rect.position *= scale
|
||||
rect.size *= scale
|
||||
|
||||
return rect
|
||||
|
||||
|
||||
# returns number of empty collumns
|
||||
func _scan_empty_pixels(from_x: int, to_x: int, from_y: int, to_y: int) -> int:
|
||||
var img_data := source_texture.get_data()
|
||||
img_data.lock()
|
||||
var c = 0
|
||||
|
||||
var dir = 1
|
||||
if from_x > to_x:
|
||||
dir = -1
|
||||
|
||||
for x in range(from_x, to_x, dir):
|
||||
for y in range(from_y, to_y):
|
||||
var pix := img_data.get_pixel(x, y)
|
||||
if pix.a != 0.0:
|
||||
return c
|
||||
c += 1
|
||||
img_data.unlock()
|
||||
|
||||
return c
|
||||
|
||||
|
||||
func get_local_position(position: Vector2) -> Vector2:
|
||||
var pos = ((position - texture_offset * scale) / ((rect_size + rect_gap) * scale)).floor()
|
||||
return pos
|
||||
|
||||
|
||||
func get_char_at_position(position: Vector2) -> String:
|
||||
var tex_size = scaled_texture.get_size()
|
||||
if position.x < 0.0 or position.y < 0.0 or position.x > tex_size.x or position.y > tex_size.y:
|
||||
return ""
|
||||
|
||||
var pos = get_local_position(position)
|
||||
|
||||
if pos.y >= char_codes.size() or pos.y < 0:
|
||||
return ""
|
||||
|
||||
var line: Array = char_codes[pos.y]
|
||||
|
||||
if pos.x >= line.size() or pos.x < 0:
|
||||
return ""
|
||||
|
||||
return char(line[pos.x])
|
||||
|
||||
func get_rect_for_position(position: Vector2):
|
||||
var tex_size = scaled_texture.get_size()
|
||||
if position.x < 0.0 or position.y < 0.0 or position.x > tex_size.x or position.y > tex_size.y:
|
||||
return null
|
||||
|
||||
var pos = get_local_position(position)
|
||||
return Rect2(
|
||||
((rect_size + rect_gap) * pos + texture_offset) * scale,
|
||||
rect_size * scale
|
||||
)
|
||||
@@ -0,0 +1,168 @@
|
||||
tool
|
||||
extends Resource
|
||||
|
||||
var char_utils := preload("../Util/CharUtils.gd").new()
|
||||
|
||||
# {
|
||||
# for_char: String = {
|
||||
# advance: int,
|
||||
# offset: Vector2
|
||||
# }
|
||||
# }
|
||||
export var char_settings: Dictionary
|
||||
|
||||
# [
|
||||
# {
|
||||
# from: String,
|
||||
# to: String,
|
||||
# kerning: int
|
||||
# }
|
||||
# ]
|
||||
export var kerning_pairs: Array
|
||||
|
||||
export var gap := 2
|
||||
export var horizontal_align := 1
|
||||
export var vertical_align := 0
|
||||
export var monospace := false
|
||||
|
||||
|
||||
export var preview_color: Color = Color("202431")
|
||||
export var preview_chars: String
|
||||
|
||||
|
||||
func get_default_setting():
|
||||
return {
|
||||
advance = 0.0,
|
||||
offset = Vector2.ZERO
|
||||
}
|
||||
|
||||
func _init():
|
||||
char_settings = {}
|
||||
kerning_pairs = []
|
||||
|
||||
# ------ Settings Functions ------
|
||||
|
||||
func add_setting(for_char: String) -> Dictionary:
|
||||
char_settings[for_char] = {
|
||||
advance = 0.0,
|
||||
offset = Vector2.ZERO
|
||||
}
|
||||
|
||||
return char_settings[for_char]
|
||||
|
||||
|
||||
func insert_setting(for_char: String, setting: Dictionary):
|
||||
char_settings[for_char] = setting
|
||||
|
||||
|
||||
func remove_setting(for_char: String):
|
||||
if char_settings.has(for_char):
|
||||
char_settings.erase(for_char)
|
||||
|
||||
|
||||
func set_setting(for_char: String, advance: int, offset: Vector2):
|
||||
char_settings[for_char] = {
|
||||
advance = advance,
|
||||
offset = offset
|
||||
}
|
||||
|
||||
|
||||
func get_setting(char_code: int):
|
||||
if char_code == -1:
|
||||
return get_default_setting()
|
||||
|
||||
for char_string in char_settings:
|
||||
var char_codes: Array = char_utils.chars_to_codes(char_string).front()
|
||||
if char_code in char_codes:
|
||||
return char_settings[char_string]
|
||||
|
||||
return get_default_setting()
|
||||
|
||||
|
||||
func set_advance(for_char: String, advance: int):
|
||||
if not char_settings.has(for_char):
|
||||
add_setting(for_char)
|
||||
|
||||
char_settings[for_char].advance = advance
|
||||
|
||||
|
||||
func set_offset(for_char: String, offset: Vector2):
|
||||
if not char_settings.has(for_char):
|
||||
add_setting(for_char)
|
||||
|
||||
char_settings[for_char].offset = offset
|
||||
|
||||
|
||||
func get_advance(for_char: String):
|
||||
if char_settings.has(for_char):
|
||||
return char_settings[for_char].advance
|
||||
else:
|
||||
return 0.0
|
||||
|
||||
|
||||
func get_offset(for_char: String):
|
||||
if char_settings.has(for_char):
|
||||
return char_settings[for_char].offset
|
||||
else:
|
||||
return Vector2.ZERO
|
||||
|
||||
|
||||
# ------ Kerning Pair Functions ------
|
||||
|
||||
func add_kerning_pair() -> Dictionary:
|
||||
var new_pair = {
|
||||
from = "",
|
||||
to = "",
|
||||
kerning = 0
|
||||
}
|
||||
|
||||
kerning_pairs.append(new_pair)
|
||||
return new_pair
|
||||
|
||||
|
||||
func insert_kerning_pair(idx: int, new_kerning: Dictionary):
|
||||
kerning_pairs.insert(idx, new_kerning)
|
||||
|
||||
|
||||
func remove_kerning_pair(idx: int):
|
||||
kerning_pairs.remove(idx)
|
||||
|
||||
|
||||
func set_kerning_pair(idx: int, new_kerning: Dictionary):
|
||||
kerning_pairs[idx] = new_kerning
|
||||
|
||||
|
||||
func set_kerning_pair_from(idx: int, new_from: String):
|
||||
kerning_pairs[idx].from = new_from
|
||||
|
||||
|
||||
func set_kerning_pair_to(idx: int, new_to: String):
|
||||
kerning_pairs[idx].to = new_to
|
||||
|
||||
|
||||
func set_kerning_pair_kerning(idx: int, new_kerning: int):
|
||||
kerning_pairs[idx].kerning = new_kerning
|
||||
|
||||
|
||||
func get_kerning_pair(idx: int) -> Dictionary:
|
||||
return kerning_pairs[idx]
|
||||
|
||||
|
||||
func solve_kerning_pairs() -> Array:
|
||||
var solved_list := []
|
||||
for pair in kerning_pairs:
|
||||
if pair.from == "" or pair.to == "" or pair.kerning == 0:
|
||||
continue
|
||||
|
||||
var from_array: Array = char_utils.chars_to_codes(pair.from).front()
|
||||
var to_array: Array = char_utils.chars_to_codes(pair.to).front()
|
||||
|
||||
for a in from_array:
|
||||
for b in to_array:
|
||||
solved_list.append({
|
||||
char_a = a,
|
||||
char_b = b,
|
||||
kerning = pair.kerning
|
||||
})
|
||||
|
||||
return solved_list
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Laila L. (ElectronicBlueberry)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,61 @@
|
||||
tool
|
||||
extends VBoxContainer
|
||||
|
||||
signal change
|
||||
signal delete
|
||||
|
||||
var font_settings
|
||||
var for_char: String
|
||||
|
||||
onready var char_edit := $Heading/Char
|
||||
onready var advance := $MarginContainer/HBoxContainer/VBoxContainer/SpinBox
|
||||
onready var offset := $MarginContainer/HBoxContainer/Vector2Edit
|
||||
|
||||
func _ready():
|
||||
if for_char:
|
||||
char_edit.text = for_char
|
||||
advance.value = font_settings.get_advance(for_char)
|
||||
offset.value = font_settings.get_offset(for_char)
|
||||
|
||||
|
||||
func _on_DeleteButton_pressed():
|
||||
emit_signal("delete", self)
|
||||
|
||||
|
||||
func _on_Char_text_changed(to_char: String):
|
||||
# if char is emptied
|
||||
if to_char.length() == 0:
|
||||
if for_char:
|
||||
font_settings.remove_setting(for_char)
|
||||
emit_signal("change")
|
||||
return
|
||||
|
||||
# char allready exists, ignore
|
||||
if to_char in font_settings.char_settings:
|
||||
return
|
||||
|
||||
|
||||
# if char was set before, delete old entry
|
||||
if for_char:
|
||||
font_settings.remove_setting(for_char)
|
||||
|
||||
# add new char setting
|
||||
font_settings.add_setting(to_char)
|
||||
font_settings.set_setting(to_char, advance.value, offset.value)
|
||||
|
||||
|
||||
for_char = to_char
|
||||
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_SpinBox_value_changed(value):
|
||||
if for_char:
|
||||
font_settings.set_advance(for_char, value)
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_Vector2Edit_value_changed(value):
|
||||
if for_char:
|
||||
font_settings.set_offset(for_char, value)
|
||||
emit_signal("change")
|
||||
@@ -0,0 +1,102 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/Vector2Edit.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/CharSetting.gd" type="Script" id=2]
|
||||
|
||||
[node name="CharSetting" type="VBoxContainer"]
|
||||
anchor_right = 0.326172
|
||||
anchor_bottom = 0.117
|
||||
margin_bottom = -40.1998
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Heading" type="HBoxContainer" parent="."]
|
||||
margin_right = 341.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Label" type="Label" parent="Heading"]
|
||||
margin_top = 5.0
|
||||
margin_right = 17.0
|
||||
margin_bottom = 19.0
|
||||
text = "for"
|
||||
|
||||
[node name="Char" type="LineEdit" parent="Heading"]
|
||||
margin_left = 21.0
|
||||
margin_right = 149.0
|
||||
margin_bottom = 24.0
|
||||
rect_min_size = Vector2( 128, 0 )
|
||||
placeholder_text = "char(s)"
|
||||
caret_blink = true
|
||||
caret_blink_speed = 0.5
|
||||
|
||||
[node name="HSeparator" type="Control" parent="Heading"]
|
||||
margin_left = 153.0
|
||||
margin_right = 282.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="Heading"]
|
||||
margin_left = 286.0
|
||||
margin_right = 341.0
|
||||
margin_bottom = 24.0
|
||||
text = "Delete"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
margin_top = 28.0
|
||||
margin_right = 341.0
|
||||
margin_bottom = 70.0
|
||||
custom_constants/margin_right = 8
|
||||
custom_constants/margin_left = 8
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 8.0
|
||||
margin_right = 333.0
|
||||
margin_bottom = 42.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/separation = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
|
||||
margin_right = 134.0
|
||||
margin_bottom = 42.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Heading" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_right = 134.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer/Heading"]
|
||||
margin_right = 54.0
|
||||
margin_bottom = 14.0
|
||||
text = "Advance"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/HBoxContainer/VBoxContainer/Heading"]
|
||||
margin_left = 58.0
|
||||
margin_right = 134.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_top = 18.0
|
||||
margin_right = 134.0
|
||||
margin_bottom = 42.0
|
||||
min_value = -100.0
|
||||
|
||||
[node name="Vector2Edit" parent="MarginContainer/HBoxContainer" instance=ExtResource( 1 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 142.0
|
||||
margin_right = 325.0
|
||||
margin_bottom = 42.0
|
||||
size_flags_horizontal = 3
|
||||
min_value = Vector2( -4096, -4096 )
|
||||
max_value = Vector2( 4096, 4096 )
|
||||
value = Vector2( 0, 0 )
|
||||
label = "Offset"
|
||||
|
||||
[connection signal="text_changed" from="Heading/Char" to="." method="_on_Char_text_changed"]
|
||||
[connection signal="pressed" from="Heading/DeleteButton" to="." method="_on_DeleteButton_pressed"]
|
||||
[connection signal="value_changed" from="MarginContainer/HBoxContainer/VBoxContainer/SpinBox" to="." method="_on_SpinBox_value_changed"]
|
||||
[connection signal="value_changed" from="MarginContainer/HBoxContainer/Vector2Edit" to="." method="_on_Vector2Edit_value_changed"]
|
||||
@@ -0,0 +1,45 @@
|
||||
tool
|
||||
extends MarginContainer
|
||||
|
||||
signal file_removed
|
||||
signal file_changed
|
||||
|
||||
onready var name_label := $MarginContainer/HBoxContainer/ClipLabel/Label
|
||||
onready var preview := $MarginContainer/HBoxContainer/ImageContainer/TexturePreview
|
||||
onready var panel := $Panel
|
||||
|
||||
var texture: Texture
|
||||
onready var selected := false setget set_selected, get_selected
|
||||
var _selected: bool
|
||||
func set_selected(new_selected: bool):
|
||||
_selected = new_selected
|
||||
|
||||
if not is_inside_tree():
|
||||
return
|
||||
|
||||
var stylebox: StyleBoxFlat = panel.get("custom_styles/panel")
|
||||
|
||||
if new_selected:
|
||||
stylebox.bg_color.a = 0.2
|
||||
stylebox.border_color.a = 0.2
|
||||
else:
|
||||
stylebox.bg_color.a = 0.0
|
||||
stylebox.border_color.a = 0.0
|
||||
func get_selected() -> bool:
|
||||
return _selected
|
||||
|
||||
func set_texture(new_texture: Texture):
|
||||
if is_inside_tree():
|
||||
name_label.text = new_texture.resource_path
|
||||
preview.texture = new_texture
|
||||
texture = new_texture
|
||||
|
||||
|
||||
func _on_DeleteButton_pressed():
|
||||
emit_signal("file_removed", self)
|
||||
self.queue_free()
|
||||
|
||||
|
||||
func _on_ToolButton_pressed():
|
||||
emit_signal("file_changed", self)
|
||||
self.selected = true
|
||||
@@ -0,0 +1,123 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/Assets/TransparentBG_small.png" type="Texture" id=1]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/File.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
resource_local_to_scene = true
|
||||
bg_color = Color( 0.376471, 0.392157, 0.509804, 0 )
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color( 0.823529, 0.894118, 0.87451, 0 )
|
||||
|
||||
[node name="File" type="MarginContainer"]
|
||||
anchor_right = 0.292
|
||||
anchor_bottom = 0.1
|
||||
margin_right = -0.00802612
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
margin_right = 298.0
|
||||
margin_bottom = 60.0
|
||||
mouse_filter = 2
|
||||
custom_styles/panel = SubResource( 1 )
|
||||
|
||||
[node name="ToolButton" type="ToolButton" parent="."]
|
||||
margin_right = 298.0
|
||||
margin_bottom = 60.0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
margin_right = 298.0
|
||||
margin_bottom = 60.0
|
||||
mouse_filter = 2
|
||||
custom_constants/margin_right = 6
|
||||
custom_constants/margin_top = 6
|
||||
custom_constants/margin_left = 6
|
||||
custom_constants/margin_bottom = 6
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 6.0
|
||||
margin_top = 6.0
|
||||
margin_right = 292.0
|
||||
margin_bottom = 54.0
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ImageContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"]
|
||||
margin_right = 48.0
|
||||
margin_bottom = 48.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/ImageContainer"]
|
||||
margin_right = 48.0
|
||||
margin_bottom = 48.0
|
||||
rect_min_size = Vector2( 48, 48 )
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 5
|
||||
size_flags_vertical = 4
|
||||
texture = ExtResource( 1 )
|
||||
expand = true
|
||||
stretch_mode = 2
|
||||
|
||||
[node name="TexturePreview" type="TextureRect" parent="MarginContainer/HBoxContainer/ImageContainer"]
|
||||
margin_right = 48.0
|
||||
margin_bottom = 48.0
|
||||
rect_min_size = Vector2( 48, 48 )
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 5
|
||||
size_flags_vertical = 4
|
||||
expand = true
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="ClipLabel" type="Control" parent="MarginContainer/HBoxContainer"]
|
||||
margin_left = 52.0
|
||||
margin_right = 227.0
|
||||
margin_bottom = 48.0
|
||||
rect_clip_content = true
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 7
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/ClipLabel"]
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 12.0
|
||||
margin_right = 42.0
|
||||
margin_bottom = -12.0
|
||||
size_flags_vertical = 6
|
||||
text = "Texture"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"]
|
||||
margin_left = 231.0
|
||||
margin_right = 286.0
|
||||
margin_bottom = 48.0
|
||||
mouse_filter = 2
|
||||
custom_constants/margin_top = 12
|
||||
custom_constants/margin_bottom = 12
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="MarginContainer/HBoxContainer/MarginContainer"]
|
||||
margin_top = 12.0
|
||||
margin_right = 55.0
|
||||
margin_bottom = 36.0
|
||||
text = "Delete"
|
||||
|
||||
[connection signal="pressed" from="ToolButton" to="." method="_on_ToolButton_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MarginContainer/DeleteButton" to="." method="_on_DeleteButton_pressed"]
|
||||
@@ -0,0 +1,47 @@
|
||||
tool
|
||||
extends HBoxContainer
|
||||
|
||||
|
||||
signal change
|
||||
signal delete
|
||||
|
||||
onready var fromLine = $LineEditFrom
|
||||
onready var toLine = $LineEditTo
|
||||
onready var offsetLine = $SpinBoxOffset
|
||||
|
||||
var font_settings
|
||||
|
||||
|
||||
onready var idx := get_index()
|
||||
|
||||
|
||||
# Dict which holds info about a kerning pair
|
||||
#
|
||||
# Kerning: {
|
||||
# from: String,
|
||||
# to: String,
|
||||
# kerning: float
|
||||
# }
|
||||
func set_kerning_pair(new_kerning):
|
||||
fromLine.text = new_kerning.from
|
||||
toLine.text = new_kerning.to
|
||||
offsetLine.value = new_kerning.kerning
|
||||
|
||||
|
||||
func _on_LineEditFrom_text_changed(new_text):
|
||||
font_settings.set_kerning_pair_from(idx, new_text)
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_LineEditTo_text_changed(new_text):
|
||||
font_settings.set_kerning_pair_to(idx, new_text)
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_SpinBoxOffset_value_changed(value):
|
||||
font_settings.set_kerning_pair_kerning(idx, value)
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_DeleteButton_pressed():
|
||||
emit_signal("delete", self)
|
||||
@@ -0,0 +1,85 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/KerningPair.gd" type="Script" id=1]
|
||||
|
||||
[node name="KerningPair" type="HBoxContainer"]
|
||||
anchor_left = -0.000976563
|
||||
anchor_right = 0.545523
|
||||
anchor_bottom = 0.04
|
||||
margin_right = 0.383972
|
||||
margin_bottom = -1.90735e-06
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": true
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_top = 5.0
|
||||
margin_right = 30.0
|
||||
margin_bottom = 19.0
|
||||
text = "from"
|
||||
|
||||
[node name="LineEditFrom" type="LineEdit" parent="."]
|
||||
margin_left = 34.0
|
||||
margin_right = 181.0
|
||||
margin_bottom = 25.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
align = 1
|
||||
placeholder_text = "abc"
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
margin_left = 185.0
|
||||
margin_top = 5.0
|
||||
margin_right = 198.0
|
||||
margin_bottom = 19.0
|
||||
text = "to"
|
||||
|
||||
[node name="LineEditTo" type="LineEdit" parent="."]
|
||||
margin_left = 202.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 25.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
align = 1
|
||||
placeholder_text = "123"
|
||||
|
||||
[node name="Label3" type="Label" parent="."]
|
||||
margin_left = 354.0
|
||||
margin_top = 5.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 19.0
|
||||
text = ":"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="SpinBoxOffset" type="SpinBox" parent="."]
|
||||
margin_left = 362.0
|
||||
margin_right = 436.0
|
||||
margin_bottom = 25.0
|
||||
min_value = -4096.0
|
||||
max_value = 4096.0
|
||||
align = 2
|
||||
|
||||
[node name="Seperator" type="Control" parent="."]
|
||||
margin_left = 440.0
|
||||
margin_right = 514.0
|
||||
margin_bottom = 25.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="."]
|
||||
margin_left = 518.0
|
||||
margin_right = 573.0
|
||||
margin_bottom = 25.0
|
||||
text = "Delete"
|
||||
|
||||
[connection signal="text_changed" from="LineEditFrom" to="." method="_on_LineEditFrom_text_changed"]
|
||||
[connection signal="text_changed" from="LineEditTo" to="." method="_on_LineEditTo_text_changed"]
|
||||
[connection signal="value_changed" from="SpinBoxOffset" to="." method="_on_SpinBoxOffset_value_changed"]
|
||||
[connection signal="pressed" from="DeleteButton" to="." method="_on_DeleteButton_pressed"]
|
||||
@@ -0,0 +1,35 @@
|
||||
tool
|
||||
extends Container
|
||||
|
||||
var texture: Texture
|
||||
|
||||
func set_texture(tex: Texture):
|
||||
texture = tex
|
||||
self.offset = Vector2.ZERO
|
||||
|
||||
const margin := 8.0
|
||||
|
||||
export var offset := Vector2.ZERO setget set_offset, get_offset
|
||||
func set_offset(new_offset: Vector2):
|
||||
if not texture:
|
||||
return
|
||||
|
||||
var rect := self.get_rect()
|
||||
var t_size = texture.get_size()
|
||||
var child: Control = get_children().front()
|
||||
var scale = child.rect_scale
|
||||
|
||||
var total_bounds = (rect.size + t_size * scale) / 2.0
|
||||
|
||||
offset.x = clamp(new_offset.x, -total_bounds.x + margin, total_bounds.x - margin)
|
||||
offset.y = clamp(new_offset.y, -total_bounds.y + margin, total_bounds.y - margin)
|
||||
rect.position += offset
|
||||
|
||||
fit_child_in_rect(get_children().front(), rect)
|
||||
child.rect_scale = scale
|
||||
func get_offset() -> Vector2:
|
||||
return offset
|
||||
|
||||
|
||||
func _on_TextureContainer_resized():
|
||||
set_offset(offset)
|
||||
@@ -0,0 +1,33 @@
|
||||
tool
|
||||
extends TextureRect
|
||||
|
||||
|
||||
var hover := false
|
||||
var texture_font_mapping
|
||||
|
||||
|
||||
onready var rect_preview := $RectPreview
|
||||
onready var label := $RectPreview/Label
|
||||
|
||||
|
||||
func _on_TextureView_mouse_entered():
|
||||
hover = true
|
||||
rect_preview.visible = true
|
||||
|
||||
|
||||
func _on_TextureView_mouse_exited():
|
||||
hover = false
|
||||
rect_preview.visible = false
|
||||
|
||||
func _gui_input(event):
|
||||
if hover and event is InputEventMouseMotion:
|
||||
var c = texture_font_mapping.get_char_at_position(event.position)
|
||||
if c == "":
|
||||
rect_preview.visible = false
|
||||
return
|
||||
else:
|
||||
label.text = c
|
||||
var rect: Rect2 = texture_font_mapping.get_rect_for_position(event.position)
|
||||
rect_preview.rect_position = rect.position
|
||||
rect_preview.rect_size = rect.size
|
||||
rect_preview.visible = true
|
||||
@@ -0,0 +1,65 @@
|
||||
tool
|
||||
extends VBoxContainer
|
||||
|
||||
onready var texture_view := $Control/TextureContainer/TextureView
|
||||
onready var texture_container := $Control/TextureContainer
|
||||
onready var zoom_spinbox := $Heading/SpinBox
|
||||
|
||||
var hover := false
|
||||
|
||||
var zoom := 100.0 setget set_zoom, get_zoom
|
||||
var _zoom := 100.0
|
||||
func set_zoom(new_zoom):
|
||||
_zoom = clamp(new_zoom, 10, 5000)
|
||||
texture_view.rect_scale = Vector2(float(_zoom) / 100.0, float(_zoom) / 100.0)
|
||||
texture_view.rect_pivot_offset = texture_view.rect_size / 2.0
|
||||
func get_zoom():
|
||||
return _zoom
|
||||
|
||||
|
||||
var texture_font_mapping setget set_mapping
|
||||
func set_mapping(new_mapping):
|
||||
texture_view.texture_font_mapping = new_mapping
|
||||
|
||||
|
||||
func zoom_in():
|
||||
self.zoom *= 1.1
|
||||
zoom_spinbox.value = self.zoom
|
||||
|
||||
func zoom_out():
|
||||
self.zoom *= 0.9
|
||||
zoom_spinbox.value = self.zoom
|
||||
|
||||
|
||||
func set_texture(texture: Texture):
|
||||
if is_inside_tree():
|
||||
texture_container.set_texture(texture)
|
||||
texture_view.texture = texture
|
||||
texture_view.rect_size = texture.get_size()
|
||||
texture_view.rect_pivot_offset = texture_view.rect_size / 2.0
|
||||
|
||||
func _input(event):
|
||||
if hover:
|
||||
if event is InputEventMouseButton and event.pressed:
|
||||
match event.button_index:
|
||||
BUTTON_WHEEL_UP:
|
||||
zoom_in()
|
||||
BUTTON_WHEEL_DOWN:
|
||||
zoom_out()
|
||||
elif event is InputEventMouseMotion:
|
||||
event = event as InputEventMouseMotion
|
||||
|
||||
if event.button_mask & BUTTON_LEFT:
|
||||
texture_container.offset += event.relative
|
||||
|
||||
|
||||
func _on_SpinBox_value_changed(value):
|
||||
self.zoom = value
|
||||
|
||||
|
||||
func _on_TextureContainer_mouse_entered():
|
||||
hover = true
|
||||
|
||||
|
||||
func _on_TextureContainer_mouse_exited():
|
||||
hover = false
|
||||
@@ -0,0 +1,142 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/Assets/Fonts/RobotoMono/RobotoMono-Medium.ttf" type="DynamicFontData" id=2]
|
||||
[ext_resource path="res://addons/texture_fonts/Assets/TransparentBG.png" type="Texture" id=3]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/TextureViewer/TextureViewer.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/TextureViewer/TextureView.gd" type="Script" id=5]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/TextureViewer/TextureContainer.gd" type="Script" id=6]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
extra_spacing_top = -2
|
||||
extra_spacing_bottom = 5
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[node name="TextureViewer" type="VBoxContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Heading" type="HBoxContainer" parent="."]
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Label" type="Label" parent="Heading"]
|
||||
margin_top = 5.0
|
||||
margin_right = 82.0
|
||||
margin_bottom = 19.0
|
||||
text = "View Texture"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Heading"]
|
||||
margin_left = 86.0
|
||||
margin_right = 901.0
|
||||
margin_bottom = 24.0
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label2" type="Label" parent="Heading"]
|
||||
margin_left = 905.0
|
||||
margin_top = 5.0
|
||||
margin_right = 946.0
|
||||
margin_bottom = 19.0
|
||||
text = "Zoom:"
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="Heading"]
|
||||
margin_left = 950.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 24.0
|
||||
min_value = 10.0
|
||||
max_value = 5000.0
|
||||
step = 10.0
|
||||
value = 100.0
|
||||
exp_edit = true
|
||||
suffix = "%"
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
margin_top = 28.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 600.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource( 3 )
|
||||
expand = true
|
||||
stretch_mode = 2
|
||||
|
||||
[node name="TextureContainer" type="Container" parent="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_clip_content = true
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource( 6 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureView" type="TextureRect" parent="Control/TextureContainer"]
|
||||
margin_left = 512.0
|
||||
margin_top = 286.0
|
||||
margin_right = 512.0
|
||||
margin_bottom = 286.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
stretch_mode = 3
|
||||
script = ExtResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="RectPreview" type="ColorRect" parent="Control/TextureContainer/TextureView"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 5
|
||||
size_flags_vertical = 5
|
||||
color = Color( 1, 0, 0, 0.431373 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Control/TextureContainer/TextureView/RectPreview"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -5.0
|
||||
margin_top = -11.0
|
||||
margin_right = 5.0
|
||||
margin_bottom = 11.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 0.45098 )
|
||||
text = "a"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="value_changed" from="Heading/SpinBox" to="." method="_on_SpinBox_value_changed"]
|
||||
[connection signal="mouse_entered" from="Control/TextureContainer" to="." method="_on_TextureContainer_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="Control/TextureContainer" to="." method="_on_TextureContainer_mouse_exited"]
|
||||
[connection signal="resized" from="Control/TextureContainer" to="Control/TextureContainer" method="_on_TextureContainer_resized"]
|
||||
[connection signal="mouse_entered" from="Control/TextureContainer/TextureView" to="Control/TextureContainer/TextureView" method="_on_TextureView_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="Control/TextureContainer/TextureView" to="Control/TextureContainer/TextureView" method="_on_TextureView_mouse_exited"]
|
||||
@@ -0,0 +1,70 @@
|
||||
tool
|
||||
extends VBoxContainer
|
||||
|
||||
signal value_changed(value)
|
||||
|
||||
onready var label_node := $Heading/Label
|
||||
onready var x_node := $Values/X
|
||||
onready var y_node := $Values/Y
|
||||
|
||||
|
||||
export(Vector2) var min_value: Vector2 = Vector2(-100.0, -100.0) setget set_min_value, get_min_value
|
||||
var _min_value := Vector2(-100.0, -100.0)
|
||||
func set_min_value(new_value: Vector2):
|
||||
_min_value = new_value
|
||||
if is_instance_valid(x_node) and is_instance_valid(y_node):
|
||||
x_node.min_value = new_value.x
|
||||
y_node.min_value = new_value.y
|
||||
func get_min_value():
|
||||
if is_instance_valid(x_node) and is_instance_valid(y_node):
|
||||
return Vector2(x_node.min_value, y_node.min_value)
|
||||
|
||||
export(Vector2) var max_value: Vector2 = Vector2.ZERO setget set_max_value, get_max_value
|
||||
var _max_value := Vector2(100.0, 100.0)
|
||||
func set_max_value(new_value: Vector2):
|
||||
_max_value = new_value
|
||||
if is_instance_valid(x_node) and is_instance_valid(y_node):
|
||||
x_node.max_value = new_value.x
|
||||
y_node.max_value = new_value.y
|
||||
func get_max_value():
|
||||
if is_instance_valid(x_node) and is_instance_valid(y_node):
|
||||
return Vector2(x_node.max_value, y_node.max_value)
|
||||
|
||||
|
||||
export(Vector2) var value: Vector2 setget set_value, get_value
|
||||
var _value := Vector2.ZERO
|
||||
func set_value(new_value: Vector2):
|
||||
_value = new_value
|
||||
if is_instance_valid(x_node) and is_instance_valid(y_node):
|
||||
x_node.value = new_value.x
|
||||
y_node.value = new_value.y
|
||||
func get_value():
|
||||
if is_instance_valid(x_node) and is_instance_valid(y_node):
|
||||
return Vector2(x_node.value, y_node.value)
|
||||
|
||||
|
||||
export(String) var label := "Label" setget set_label, get_label
|
||||
var _label := "Label"
|
||||
func set_label(new_label: String):
|
||||
_label = new_label
|
||||
if is_instance_valid(label_node):
|
||||
label_node.text = new_label
|
||||
func get_label():
|
||||
if is_instance_valid(label_node):
|
||||
return label_node.text
|
||||
|
||||
|
||||
func _ready():
|
||||
set_label(_label)
|
||||
set_value(_value)
|
||||
set_min_value(_min_value)
|
||||
set_max_value(_max_value)
|
||||
|
||||
|
||||
func _on_X_value_changed(new_value):
|
||||
value.x = new_value
|
||||
emit_signal("value_changed", value)
|
||||
|
||||
func _on_Y_value_changed(new_value):
|
||||
value.y = new_value
|
||||
emit_signal("value_changed", value)
|
||||
@@ -0,0 +1,70 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/Vector2Edit.gd" type="Script" id=1]
|
||||
|
||||
[node name="Vector2Edit" type="VBoxContainer"]
|
||||
anchor_right = 0.179
|
||||
anchor_bottom = 0.07
|
||||
margin_right = -32.2959
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": true
|
||||
}
|
||||
min_value = null
|
||||
max_value = null
|
||||
value = null
|
||||
label = null
|
||||
|
||||
[node name="Heading" type="HBoxContainer" parent="."]
|
||||
margin_right = 183.0
|
||||
margin_bottom = 14.0
|
||||
|
||||
[node name="Label" type="Label" parent="Heading"]
|
||||
margin_right = 34.0
|
||||
margin_bottom = 14.0
|
||||
text = "Label"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Heading"]
|
||||
margin_left = 38.0
|
||||
margin_right = 183.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Values" type="HBoxContainer" parent="."]
|
||||
margin_top = 18.0
|
||||
margin_right = 183.0
|
||||
margin_bottom = 42.0
|
||||
|
||||
[node name="XLabel" type="Label" parent="Values"]
|
||||
margin_top = 5.0
|
||||
margin_right = 12.0
|
||||
margin_bottom = 19.0
|
||||
text = "X:"
|
||||
|
||||
[node name="X" type="SpinBox" parent="Values"]
|
||||
margin_left = 16.0
|
||||
margin_right = 90.0
|
||||
margin_bottom = 24.0
|
||||
min_value = -100.0
|
||||
|
||||
[node name="YLabel" type="Label" parent="Values"]
|
||||
margin_left = 94.0
|
||||
margin_top = 5.0
|
||||
margin_right = 105.0
|
||||
margin_bottom = 19.0
|
||||
text = "Y:"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Y" type="SpinBox" parent="Values"]
|
||||
margin_left = 109.0
|
||||
margin_right = 183.0
|
||||
margin_bottom = 24.0
|
||||
min_value = -100.0
|
||||
|
||||
[connection signal="value_changed" from="Values/X" to="." method="_on_X_value_changed"]
|
||||
[connection signal="value_changed" from="Values/Y" to="." method="_on_Y_value_changed"]
|
||||
@@ -0,0 +1,88 @@
|
||||
tool
|
||||
extends MarginContainer
|
||||
|
||||
signal change
|
||||
|
||||
onready var size := $VBoxContainer/RectSettings/Size
|
||||
onready var gap := $VBoxContainer/RectSettings/Gap
|
||||
onready var offset := $VBoxContainer/RectSettings/Offset
|
||||
onready var chars := $VBoxContainer/HSplitContainer/HBoxContainer/TextEdit
|
||||
onready var texture_viewer := $VBoxContainer/HSplitContainer/TextureViewer
|
||||
onready var scale := $VBoxContainer/RectSettings/Scaling/HBoxContainer/Scale
|
||||
onready var interpolation := $VBoxContainer/RectSettings/Scaling/HBoxContainer/Interpolation
|
||||
|
||||
var current_mapping #: TextureFontMapping
|
||||
|
||||
|
||||
var interpolation_options = [
|
||||
Image.INTERPOLATE_BILINEAR,
|
||||
Image.INTERPOLATE_CUBIC,
|
||||
Image.INTERPOLATE_LANCZOS,
|
||||
Image.INTERPOLATE_NEAREST,
|
||||
Image.INTERPOLATE_TRILINEAR
|
||||
]
|
||||
|
||||
|
||||
func _ready():
|
||||
interpolation.clear()
|
||||
interpolation.add_item("Bilinear")
|
||||
interpolation.add_item("Cubic")
|
||||
interpolation.add_item("Lanczos")
|
||||
interpolation.add_item("Nearest")
|
||||
interpolation.add_item("Trilinear")
|
||||
|
||||
|
||||
func set_mapping(mapping):
|
||||
current_mapping = mapping
|
||||
|
||||
var texture: Texture = mapping.source_texture
|
||||
var max_size := texture.get_size()
|
||||
|
||||
size.max_value = max_size
|
||||
gap.max_value = max_size
|
||||
offset.max_value = max_size
|
||||
|
||||
size.value = mapping.rect_size
|
||||
gap.value = mapping.rect_gap
|
||||
offset.value = mapping.texture_offset
|
||||
chars.text = mapping.chars
|
||||
scale.value = mapping.scale
|
||||
interpolation.selected = interpolation_options.find(mapping.interpolation)
|
||||
|
||||
|
||||
func _on_Size_value_changed(value: Vector2):
|
||||
if current_mapping:
|
||||
current_mapping.rect_size = value
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_Gap_value_changed(value: Vector2):
|
||||
if current_mapping:
|
||||
current_mapping.rect_gap = value
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_Offset_value_changed(value: Vector2):
|
||||
if current_mapping:
|
||||
current_mapping.texture_offset = value
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_TextEdit_text_changed():
|
||||
if current_mapping:
|
||||
current_mapping.chars = chars.text
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_Scale_value_changed(value):
|
||||
if current_mapping:
|
||||
current_mapping.scale = value
|
||||
texture_viewer.set_texture(current_mapping.scaled_texture)
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_OptionButton_item_selected(index):
|
||||
if current_mapping:
|
||||
current_mapping.interpolation = interpolation_options[index]
|
||||
texture_viewer.set_texture(current_mapping.scaled_texture)
|
||||
emit_signal("change")
|
||||
@@ -0,0 +1,204 @@
|
||||
tool
|
||||
extends MarginContainer
|
||||
|
||||
signal close
|
||||
|
||||
# ------ Resources ------
|
||||
|
||||
const file_scene = preload("./Components/File.tscn")
|
||||
|
||||
# ------ References ------
|
||||
|
||||
onready var file_list := $TabContainer/Textures/Files/Panel/ScrollContainer/FileList
|
||||
onready var file_dialog := $TabContainer/Textures/Files/HeadingBox/AddTextureButton/FileDialog
|
||||
onready var file_settings := $TabContainer/Textures/FileSettings
|
||||
onready var texture_viewer := $TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer/TextureViewer
|
||||
onready var no_selection_overlay := $TabContainer/Textures/FileSettings/NoSelectionOverlay
|
||||
|
||||
onready var font_preview := $"TabContainer/Font Settings/Preview"
|
||||
onready var font_settings := $"TabContainer/Font Settings"
|
||||
|
||||
# ------ Variables ------
|
||||
|
||||
var selected_file_node
|
||||
var file_nodes: Array = []
|
||||
var font_ref: WeakRef
|
||||
|
||||
# ------ Inherited Methods -----
|
||||
|
||||
func _ready():
|
||||
file_settings.connect("change", self, "queue_save")
|
||||
font_settings.connect("change", self, "queue_save")
|
||||
|
||||
# ------ Methods ------
|
||||
|
||||
|
||||
# reset editor, and populate for new font
|
||||
func edit_font(new_font) -> void:
|
||||
if font_ref:
|
||||
save_now()
|
||||
|
||||
font_ref = weakref(new_font)
|
||||
for node in file_nodes:
|
||||
node.queue_free()
|
||||
|
||||
file_nodes.clear()
|
||||
|
||||
no_selection_overlay.visible = true
|
||||
|
||||
for mapping in new_font.texture_mappings:
|
||||
_add_texture_ui(mapping.source_texture)
|
||||
|
||||
if file_nodes.size() != 0:
|
||||
change_texture(0)
|
||||
|
||||
if is_inside_tree():
|
||||
font_settings.set_font(new_font)
|
||||
font_preview.set_font(new_font)
|
||||
|
||||
|
||||
func get_font_from_ref() -> Font:
|
||||
var font = font_ref.get_ref()
|
||||
|
||||
if font: return font
|
||||
else:
|
||||
emit_signal("close")
|
||||
return font
|
||||
|
||||
|
||||
func update_overlay():
|
||||
if is_instance_valid(selected_file_node):
|
||||
no_selection_overlay.visible = false
|
||||
else:
|
||||
no_selection_overlay.visible = true
|
||||
|
||||
|
||||
var _queued_save_count := 0
|
||||
func queue_save(timeout := 2.5):
|
||||
_queued_save_count += 1
|
||||
|
||||
if not is_inside_tree():
|
||||
return
|
||||
|
||||
var timer = Timer.new()
|
||||
add_child(timer)
|
||||
timer.start(2.5)
|
||||
yield(timer, "timeout")
|
||||
|
||||
_queued_save_count -= 1
|
||||
if _queued_save_count == 0:
|
||||
_save()
|
||||
elif _queued_save_count < 0:
|
||||
_queued_save_count += 1
|
||||
|
||||
|
||||
func save_now():
|
||||
_queued_save_count = 0
|
||||
_save()
|
||||
|
||||
|
||||
func _save():
|
||||
if font_ref and font_ref.get_ref():
|
||||
var font = get_font_from_ref()
|
||||
|
||||
font.build_font()
|
||||
|
||||
if font.resource_path == "":
|
||||
return
|
||||
|
||||
var error := ResourceSaver.save(font.resource_path, font)
|
||||
if error != OK:
|
||||
push_error("Failed to Save Font with Path: " + font.resource_path + ". Error Code: " + String(error))
|
||||
else:
|
||||
print("Saved Font: " + font.resource_path)
|
||||
else:
|
||||
emit_signal("close")
|
||||
|
||||
# ------ Actions ------
|
||||
|
||||
|
||||
func add_texture(texture: Texture, idx := -1):
|
||||
_add_texture_ui(texture, idx)
|
||||
var font = get_font_from_ref()
|
||||
font.add_texture(texture)
|
||||
change_texture(file_list.get_child_count() - 1)
|
||||
queue_save()
|
||||
|
||||
func _add_texture_ui(texture: Texture, idx := -1):
|
||||
var file_node := file_scene.instance()
|
||||
|
||||
file_list.add_child(file_node)
|
||||
file_node.set_texture(texture)
|
||||
if idx == -1:
|
||||
file_nodes.append(file_node)
|
||||
else:
|
||||
file_list.move_child(file_node, idx)
|
||||
file_nodes.insert(idx, file_node)
|
||||
|
||||
file_node.connect("file_removed", self, "_on_file_removed")
|
||||
file_node.connect("file_changed", self, "_on_file_changed")
|
||||
|
||||
|
||||
func delete_texture(node):
|
||||
var index = file_nodes.find(node)
|
||||
node.queue_free()
|
||||
file_nodes.remove(index)
|
||||
|
||||
if node == selected_file_node:
|
||||
selected_file_node = null
|
||||
|
||||
var font = get_font_from_ref()
|
||||
font.remove_texture(index)
|
||||
|
||||
update_overlay()
|
||||
queue_save()
|
||||
|
||||
|
||||
func change_texture(index: int):
|
||||
var file = file_nodes[index]
|
||||
|
||||
if is_instance_valid(selected_file_node):
|
||||
selected_file_node.selected = false
|
||||
|
||||
var font = get_font_from_ref()
|
||||
|
||||
if is_instance_valid(file):
|
||||
file.selected = true
|
||||
selected_file_node = file
|
||||
texture_viewer.set_texture(font.texture_mappings[index].scaled_texture)
|
||||
|
||||
file_settings.set_mapping(font.texture_mappings[index])
|
||||
texture_viewer.set_mapping(font.texture_mappings[index])
|
||||
|
||||
update_overlay()
|
||||
|
||||
|
||||
# ------ Signals ------
|
||||
|
||||
func _on_file_removed(file):
|
||||
if file == selected_file_node:
|
||||
selected_file_node = null
|
||||
if not file_nodes.empty():
|
||||
selected_file_node = file_nodes.front()
|
||||
selected_file_node.selected = true
|
||||
|
||||
delete_texture(file)
|
||||
update_overlay()
|
||||
|
||||
|
||||
func _on_file_changed(file):
|
||||
var idx = file_nodes.find(file)
|
||||
if idx == -1:
|
||||
return
|
||||
|
||||
change_texture(idx)
|
||||
|
||||
|
||||
func _on_AddTextureButton_pressed():
|
||||
file_dialog.popup_centered()
|
||||
|
||||
|
||||
func _on_FileDialog_file_selected(path):
|
||||
var texture = load(path)
|
||||
if texture is Texture:
|
||||
add_texture(texture)
|
||||
@@ -0,0 +1,666 @@
|
||||
[gd_scene load_steps=13 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/Vector2Edit.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/texture_fonts/Assets/ExternalLink.svg" type="Texture" id=2]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/FontSettings.gd" type="Script" id=3]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Components/TextureViewer/TextureViewer.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/texture_fonts/Assets/Fonts/RobotoMono/RobotoMono-Medium.ttf" type="DynamicFontData" id=5]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/FontEditor.gd" type="Script" id=6]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/FileSettings.gd" type="Script" id=7]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/Preview.gd" type="Script" id=8]
|
||||
[ext_resource path="res://addons/texture_fonts/UI/HelpButton.gd" type="Script" id=9]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
font_data = ExtResource( 5 )
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
resource_local_to_scene = true
|
||||
bg_color = Color( 0.12549, 0.141176, 0.192157, 1 )
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=3]
|
||||
resource_local_to_scene = true
|
||||
bg_color = Color( 0.100392, 0.112941, 0.153726, 1 )
|
||||
|
||||
[node name="FontEditor" type="MarginContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_min_size = Vector2( 0, 280 )
|
||||
size_flags_stretch_ratio = 2.0
|
||||
script = ExtResource( 6 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="."]
|
||||
margin_right = 1048.0
|
||||
margin_bottom = 628.0
|
||||
size_flags_horizontal = 3
|
||||
tab_align = 0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Textures" type="HSplitContainer" parent="TabContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 4.0
|
||||
margin_top = 32.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Files" type="VBoxContainer" parent="TabContainer/Textures"]
|
||||
margin_right = 254.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HeadingBox" type="HBoxContainer" parent="TabContainer/Textures/Files"]
|
||||
margin_right = 254.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Textures/Files/HeadingBox"]
|
||||
margin_top = 3.0
|
||||
margin_right = 30.0
|
||||
margin_bottom = 17.0
|
||||
text = "Files"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="TabContainer/Textures/Files/HeadingBox"]
|
||||
margin_left = 34.0
|
||||
margin_right = 213.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="AddTextureButton" type="Button" parent="TabContainer/Textures/Files/HeadingBox"]
|
||||
margin_left = 217.0
|
||||
margin_right = 254.0
|
||||
margin_bottom = 20.0
|
||||
text = "Add"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FileDialog" type="FileDialog" parent="TabContainer/Textures/Files/HeadingBox/AddTextureButton"]
|
||||
margin_right = 400.0
|
||||
margin_bottom = 300.0
|
||||
rect_min_size = Vector2( 400, 300 )
|
||||
size_flags_vertical = 3
|
||||
window_title = "Open a File"
|
||||
resizable = true
|
||||
mode = 0
|
||||
filters = PoolStringArray( "*.png, *.bmp, *.dds, *.exr, *.hdr, *.jpg, *.jpeg, *.tga, *.svg, *.svgz, *.webp; Textures" )
|
||||
|
||||
[node name="Panel" type="Panel" parent="TabContainer/Textures/Files"]
|
||||
margin_top = 24.0
|
||||
margin_right = 254.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Textures/Files/Panel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FileList" type="VBoxContainer" parent="TabContainer/Textures/Files/Panel/ScrollContainer"]
|
||||
margin_right = 254.0
|
||||
size_flags_horizontal = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FileSettings" type="MarginContainer" parent="TabContainer/Textures"]
|
||||
margin_left = 266.0
|
||||
margin_right = 1040.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
script = ExtResource( 7 )
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer/Textures/FileSettings"]
|
||||
margin_right = 774.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="RectSettings" type="HBoxContainer" parent="TabContainer/Textures/FileSettings/VBoxContainer"]
|
||||
margin_right = 774.0
|
||||
margin_bottom = 42.0
|
||||
custom_constants/separation = 12
|
||||
|
||||
[node name="Size" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings" instance=ExtResource( 1 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 183.0
|
||||
margin_bottom = 42.0
|
||||
min_value = Vector2( 1, 1 )
|
||||
max_value = Vector2( 100, 100 )
|
||||
value = Vector2( 1, 1 )
|
||||
label = "Rect Size"
|
||||
|
||||
[node name="Gap" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings" instance=ExtResource( 1 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 195.0
|
||||
margin_right = 378.0
|
||||
margin_bottom = 42.0
|
||||
min_value = Vector2( 0, 0 )
|
||||
max_value = Vector2( 100, 100 )
|
||||
value = Vector2( 0, 0 )
|
||||
label = "Rect Gap"
|
||||
|
||||
[node name="Offset" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings" instance=ExtResource( 1 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 390.0
|
||||
margin_right = 573.0
|
||||
margin_bottom = 42.0
|
||||
min_value = Vector2( 0, 0 )
|
||||
max_value = Vector2( 100, 100 )
|
||||
value = Vector2( 0, 0 )
|
||||
label = "Texture Offset"
|
||||
|
||||
[node name="Scaling" type="VBoxContainer" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings"]
|
||||
margin_left = 585.0
|
||||
margin_right = 741.0
|
||||
margin_bottom = 42.0
|
||||
|
||||
[node name="HeadingContainer" type="HBoxContainer" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling"]
|
||||
margin_right = 156.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling/HeadingContainer"]
|
||||
margin_right = 103.0
|
||||
margin_bottom = 14.0
|
||||
text = "Upscale Texture"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling/HeadingContainer"]
|
||||
margin_left = 107.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling"]
|
||||
margin_top = 18.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 42.0
|
||||
|
||||
[node name="Scale" type="SpinBox" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling/HBoxContainer"]
|
||||
margin_right = 74.0
|
||||
margin_bottom = 24.0
|
||||
min_value = 1.0
|
||||
max_value = 10.0
|
||||
value = 1.0
|
||||
suffix = "x"
|
||||
|
||||
[node name="Interpolation" type="OptionButton" parent="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling/HBoxContainer"]
|
||||
margin_left = 78.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 24.0
|
||||
text = "Bilinear"
|
||||
items = [ "Bilinear", null, false, 0, null, "Cubic", null, false, 1, null, "Lanczos", null, false, 2, null, "Nearest", null, false, 3, null, "Trilinear", null, false, 4, null ]
|
||||
selected = 0
|
||||
|
||||
[node name="HSplitContainer" type="HSplitContainer" parent="TabContainer/Textures/FileSettings/VBoxContainer"]
|
||||
margin_top = 46.0
|
||||
margin_right = 774.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HBoxContainer" type="VBoxContainer" parent="TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer"]
|
||||
margin_right = 381.0
|
||||
margin_bottom = 546.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HeadingBox" type="HBoxContainer" parent="TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer/HBoxContainer"]
|
||||
margin_right = 381.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="CharactersLabel" type="Label" parent="TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer/HBoxContainer/HeadingBox"]
|
||||
margin_right = 135.0
|
||||
margin_bottom = 14.0
|
||||
text = "Characters in Texture"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer/HBoxContainer/HeadingBox"]
|
||||
margin_left = 139.0
|
||||
margin_right = 381.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer/HBoxContainer"]
|
||||
margin_top = 18.0
|
||||
margin_right = 381.0
|
||||
margin_bottom = 546.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 7
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
draw_tabs = true
|
||||
draw_spaces = true
|
||||
|
||||
[node name="TextureViewer" parent="TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer" instance=ExtResource( 4 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 393.0
|
||||
margin_right = 774.0
|
||||
margin_bottom = 546.0
|
||||
|
||||
[node name="NoSelectionOverlay" type="ColorRect" parent="TabContainer/Textures/FileSettings"]
|
||||
margin_right = 774.0
|
||||
margin_bottom = 592.0
|
||||
color = Color( 0.14902, 0.172549, 0.231373, 0.784314 )
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Textures/FileSettings/NoSelectionOverlay"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
text = "Add or Select a Texture"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Font Settings" type="HSplitContainer" parent="TabContainer"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 4.0
|
||||
margin_top = 32.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="HSplitContainer" type="HSplitContainer" parent="TabContainer/Font Settings"]
|
||||
margin_right = 687.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
|
||||
[node name="Settings" type="VBoxContainer" parent="TabContainer/Font Settings/HSplitContainer"]
|
||||
margin_right = 223.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HeadingBox" type="HBoxContainer" parent="TabContainer/Font Settings/HSplitContainer/Settings"]
|
||||
margin_right = 223.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Font Settings/HSplitContainer/Settings/HeadingBox"]
|
||||
margin_right = 83.0
|
||||
margin_bottom = 14.0
|
||||
text = "Font Settings"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="TabContainer/Font Settings/HSplitContainer/Settings/HeadingBox"]
|
||||
margin_left = 87.0
|
||||
margin_right = 223.0
|
||||
margin_bottom = 14.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Font Settings/HSplitContainer/Settings"]
|
||||
margin_top = 18.0
|
||||
margin_right = 223.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 4
|
||||
custom_constants/margin_top = 4
|
||||
custom_constants/margin_left = 4
|
||||
custom_constants/margin_bottom = 4
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer"]
|
||||
margin_left = 4.0
|
||||
margin_top = 4.0
|
||||
margin_right = 219.0
|
||||
margin_bottom = 570.0
|
||||
columns = 2
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_top = 5.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 19.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Height:"
|
||||
|
||||
[node name="Height" type="SpinBox" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_left = 110.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
min_value = 1.0
|
||||
max_value = 4096.0
|
||||
value = 1.0
|
||||
|
||||
[node name="Label2" type="Label" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_top = 33.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 47.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Gap:"
|
||||
|
||||
[node name="Gap" type="SpinBox" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_left = 110.0
|
||||
margin_top = 28.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 52.0
|
||||
size_flags_horizontal = 3
|
||||
min_value = -4096.0
|
||||
max_value = 4096.0
|
||||
|
||||
[node name="Label3" type="Label" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_top = 61.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 75.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Horizontal Align:"
|
||||
|
||||
[node name="HorizontalAlign" type="SpinBox" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_left = 110.0
|
||||
margin_top = 56.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 80.0
|
||||
size_flags_horizontal = 3
|
||||
min_value = -4096.0
|
||||
max_value = 4096.0
|
||||
|
||||
[node name="Label6" type="Label" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_top = 89.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 103.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Vertical Align:"
|
||||
|
||||
[node name="VerticalAlign" type="SpinBox" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_left = 110.0
|
||||
margin_top = 84.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 108.0
|
||||
size_flags_horizontal = 3
|
||||
min_value = -4096.0
|
||||
max_value = 4096.0
|
||||
|
||||
[node name="Label4" type="Label" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_top = 117.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 131.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Ascent:"
|
||||
|
||||
[node name="Ascent" type="SpinBox" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_left = 110.0
|
||||
margin_top = 112.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 136.0
|
||||
size_flags_horizontal = 3
|
||||
max_value = 4096.0
|
||||
|
||||
[node name="Label5" type="Label" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_top = 145.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 159.0
|
||||
text = "Monospaced:"
|
||||
|
||||
[node name="MonoSpaced" type="CheckBox" parent="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid"]
|
||||
margin_left = 110.0
|
||||
margin_top = 140.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 164.0
|
||||
|
||||
[node name="ListSettings" type="VBoxContainer" parent="TabContainer/Font Settings/HSplitContainer"]
|
||||
margin_left = 235.0
|
||||
margin_right = 687.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
|
||||
[node name="VSplitContainer" type="VSplitContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings"]
|
||||
margin_right = 452.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Kerning" type="VBoxContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer"]
|
||||
margin_right = 452.0
|
||||
margin_bottom = 230.0
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
|
||||
[node name="HeadingBox" type="HBoxContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning"]
|
||||
margin_right = 452.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="KerningLabel" type="Label" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning/HeadingBox"]
|
||||
margin_top = 3.0
|
||||
margin_right = 83.0
|
||||
margin_bottom = 17.0
|
||||
text = "Kerning Pairs"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning/HeadingBox"]
|
||||
margin_left = 87.0
|
||||
margin_right = 411.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="AddKerningButton" type="Button" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning/HeadingBox"]
|
||||
margin_left = 415.0
|
||||
margin_right = 452.0
|
||||
margin_bottom = 20.0
|
||||
text = "Add"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning"]
|
||||
margin_top = 24.0
|
||||
margin_right = 452.0
|
||||
margin_bottom = 230.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 4
|
||||
custom_constants/margin_top = 4
|
||||
custom_constants/margin_left = 4
|
||||
custom_constants/margin_bottom = 4
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning/MarginContainer"]
|
||||
margin_left = 4.0
|
||||
margin_top = 4.0
|
||||
margin_right = 448.0
|
||||
margin_bottom = 202.0
|
||||
|
||||
[node name="KerningList" type="VBoxContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning/MarginContainer/ScrollContainer"]
|
||||
margin_right = 444.0
|
||||
margin_bottom = 198.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="CharSettings" type="VBoxContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer"]
|
||||
margin_top = 242.0
|
||||
margin_right = 452.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
|
||||
[node name="HeadingBox" type="HBoxContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings"]
|
||||
margin_right = 452.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings/HeadingBox"]
|
||||
margin_top = 3.0
|
||||
margin_right = 76.0
|
||||
margin_bottom = 17.0
|
||||
text = "Char Setting"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings/HeadingBox"]
|
||||
margin_left = 80.0
|
||||
margin_right = 411.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="AddCharSettingButton" type="Button" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings/HeadingBox"]
|
||||
margin_left = 415.0
|
||||
margin_right = 452.0
|
||||
margin_bottom = 20.0
|
||||
text = "Add"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings"]
|
||||
margin_top = 24.0
|
||||
margin_right = 452.0
|
||||
margin_bottom = 350.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 4
|
||||
custom_constants/margin_top = 4
|
||||
custom_constants/margin_left = 4
|
||||
custom_constants/margin_bottom = 4
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings/MarginContainer"]
|
||||
margin_left = 4.0
|
||||
margin_top = 4.0
|
||||
margin_right = 448.0
|
||||
margin_bottom = 322.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
|
||||
[node name="SettingList" type="VBoxContainer" parent="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings/MarginContainer/ScrollContainer"]
|
||||
margin_right = 444.0
|
||||
margin_bottom = 318.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Preview" type="VBoxContainer" parent="TabContainer/Font Settings"]
|
||||
margin_left = 699.0
|
||||
margin_right = 1040.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 8 )
|
||||
|
||||
[node name="HeadingBox" type="HBoxContainer" parent="TabContainer/Font Settings/Preview"]
|
||||
margin_right = 341.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Font Settings/Preview/HeadingBox"]
|
||||
margin_top = 5.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 19.0
|
||||
text = "Preview"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="TabContainer/Font Settings/Preview/HeadingBox"]
|
||||
margin_left = 54.0
|
||||
margin_right = 195.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Scale" type="SpinBox" parent="TabContainer/Font Settings/Preview/HeadingBox"]
|
||||
margin_left = 199.0
|
||||
margin_right = 273.0
|
||||
margin_bottom = 24.0
|
||||
min_value = 100.0
|
||||
max_value = 1000.0
|
||||
step = 10.0
|
||||
value = 100.0
|
||||
exp_edit = true
|
||||
suffix = "%"
|
||||
|
||||
[node name="ColorPickerButton" type="ColorPickerButton" parent="TabContainer/Font Settings/Preview/HeadingBox"]
|
||||
margin_left = 277.0
|
||||
margin_right = 341.0
|
||||
margin_bottom = 24.0
|
||||
rect_min_size = Vector2( 64, 0 )
|
||||
color = Color( 0.12549, 0.141176, 0.192157, 1 )
|
||||
|
||||
[node name="MarginContainer" type="ScrollContainer" parent="TabContainer/Font Settings/Preview"]
|
||||
margin_top = 28.0
|
||||
margin_right = 341.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="TabContainer/Font Settings/Preview/MarginContainer"]
|
||||
margin_right = 341.0
|
||||
margin_bottom = 564.0
|
||||
rect_clip_content = true
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_styles/focus = SubResource( 2 )
|
||||
custom_styles/normal = SubResource( 3 )
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
margin_right = 1048.0
|
||||
margin_bottom = 628.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="HelpButton" type="Button" parent="Control"]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -63.0
|
||||
margin_bottom = 20.0
|
||||
text = "Help"
|
||||
align = 0
|
||||
script = ExtResource( 9 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Control/HelpButton"]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -16.0
|
||||
margin_right = -4.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 2
|
||||
texture = ExtResource( 2 )
|
||||
stretch_mode = 4
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="TabContainer/Textures/Files/HeadingBox/AddTextureButton" to="." method="_on_AddTextureButton_pressed"]
|
||||
[connection signal="file_selected" from="TabContainer/Textures/Files/HeadingBox/AddTextureButton/FileDialog" to="." method="_on_FileDialog_file_selected"]
|
||||
[connection signal="value_changed" from="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Size" to="TabContainer/Textures/FileSettings" method="_on_Size_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Gap" to="TabContainer/Textures/FileSettings" method="_on_Gap_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Offset" to="TabContainer/Textures/FileSettings" method="_on_Offset_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling/HBoxContainer/Scale" to="TabContainer/Textures/FileSettings" method="_on_Scale_value_changed"]
|
||||
[connection signal="item_selected" from="TabContainer/Textures/FileSettings/VBoxContainer/RectSettings/Scaling/HBoxContainer/Interpolation" to="TabContainer/Textures/FileSettings" method="_on_OptionButton_item_selected"]
|
||||
[connection signal="text_changed" from="TabContainer/Textures/FileSettings/VBoxContainer/HSplitContainer/HBoxContainer/TextEdit" to="TabContainer/Textures/FileSettings" method="_on_TextEdit_text_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid/Height" to="TabContainer/Font Settings" method="_on_Height_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid/Gap" to="TabContainer/Font Settings" method="_on_Gap_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid/HorizontalAlign" to="TabContainer/Font Settings" method="_on_HorizontalAlign_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid/VerticalAlign" to="TabContainer/Font Settings" method="_on_VerticalAlign_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid/Ascent" to="TabContainer/Font Settings" method="_on_Ascent_value_changed"]
|
||||
[connection signal="toggled" from="TabContainer/Font Settings/HSplitContainer/Settings/MarginContainer/Grid/MonoSpaced" to="TabContainer/Font Settings" method="_on_MonoSpaced_toggled"]
|
||||
[connection signal="pressed" from="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/Kerning/HeadingBox/AddKerningButton" to="TabContainer/Font Settings" method="_on_AddKerningButton_pressed"]
|
||||
[connection signal="pressed" from="TabContainer/Font Settings/HSplitContainer/ListSettings/VSplitContainer/CharSettings/HeadingBox/AddCharSettingButton" to="TabContainer/Font Settings" method="_on_AddCharSettingButton_pressed"]
|
||||
[connection signal="value_changed" from="TabContainer/Font Settings/Preview/HeadingBox/Scale" to="TabContainer/Font Settings" method="_on_Scale_value_changed"]
|
||||
[connection signal="color_changed" from="TabContainer/Font Settings/Preview/HeadingBox/ColorPickerButton" to="TabContainer/Font Settings" method="_on_ColorPickerButton_color_changed"]
|
||||
[connection signal="text_changed" from="TabContainer/Font Settings/Preview/MarginContainer/TextEdit" to="TabContainer/Font Settings" method="_on_TextEdit_text_changed"]
|
||||
@@ -0,0 +1,169 @@
|
||||
tool
|
||||
extends HSplitContainer
|
||||
|
||||
signal change
|
||||
|
||||
onready var char_setting_list := $HSplitContainer/ListSettings/VSplitContainer/CharSettings/MarginContainer/ScrollContainer/SettingList
|
||||
onready var kerning_pair_list := $HSplitContainer/ListSettings/VSplitContainer/Kerning/MarginContainer/ScrollContainer/KerningList
|
||||
|
||||
onready var height := $HSplitContainer/Settings/MarginContainer/Grid/Height
|
||||
onready var gap := $HSplitContainer/Settings/MarginContainer/Grid/Gap
|
||||
onready var horizontal_align := $HSplitContainer/Settings/MarginContainer/Grid/HorizontalAlign
|
||||
onready var vertical_align := $HSplitContainer/Settings/MarginContainer/Grid/VerticalAlign
|
||||
onready var ascent := $HSplitContainer/Settings/MarginContainer/Grid/Ascent
|
||||
onready var monospace := $HSplitContainer/Settings/MarginContainer/Grid/MonoSpaced
|
||||
|
||||
onready var preview := $Preview
|
||||
onready var preview_textbox := $Preview/MarginContainer/TextEdit
|
||||
|
||||
const char_setting_scene := preload("./Components/CharSetting.tscn")
|
||||
const kerning_pair_scene := preload("./Components/KerningPair.tscn")
|
||||
|
||||
var font_settings
|
||||
var font_ref: WeakRef
|
||||
|
||||
|
||||
func set_font(new_font):
|
||||
font_ref = weakref(new_font)
|
||||
|
||||
height.value = new_font.height
|
||||
ascent.value = new_font.ascent
|
||||
|
||||
# clear char settings list
|
||||
for child in char_setting_list.get_children():
|
||||
char_setting_list.remove_child(child)
|
||||
child.queue_free()
|
||||
|
||||
for child in kerning_pair_list.get_children():
|
||||
kerning_pair_list.remove_child(child)
|
||||
child.queue_free()
|
||||
|
||||
font_settings = new_font.font_settings
|
||||
|
||||
# populate char settings list
|
||||
for for_char in font_settings.char_settings:
|
||||
_add_char_setting(null, for_char)
|
||||
|
||||
for kerning_pair in font_settings.kerning_pairs:
|
||||
_add_kerning_pair(null, kerning_pair)
|
||||
|
||||
gap.value = font_settings.gap
|
||||
horizontal_align.value = font_settings.horizontal_align
|
||||
vertical_align.value = font_settings.vertical_align
|
||||
monospace.pressed = font_settings.monospace
|
||||
|
||||
preview.set_preview_text(font_settings.preview_chars)
|
||||
preview.set_preview_color(font_settings.preview_color)
|
||||
|
||||
|
||||
func _add_char_setting(char_setting_node = null, for_char = null):
|
||||
if char_setting_node == null:
|
||||
char_setting_node = char_setting_scene.instance()
|
||||
|
||||
if for_char:
|
||||
char_setting_node.for_char = for_char
|
||||
|
||||
char_setting_node.font_settings = font_settings
|
||||
|
||||
char_setting_list.add_child(char_setting_node)
|
||||
char_setting_node.owner = self.owner
|
||||
char_setting_node.connect("change", self, "_value_changed")
|
||||
char_setting_node.connect("delete", self, "_on_char_setting_delete")
|
||||
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _add_kerning_pair(kerning_pair_node = null, pair = null):
|
||||
if kerning_pair_node == null:
|
||||
kerning_pair_node = kerning_pair_scene.instance()
|
||||
|
||||
kerning_pair_list.add_child(kerning_pair_node)
|
||||
kerning_pair_node.owner = self.owner
|
||||
|
||||
kerning_pair_node.font_settings = font_settings
|
||||
|
||||
if pair == null:
|
||||
pair = font_settings.add_kerning_pair()
|
||||
|
||||
kerning_pair_node.set_kerning_pair(pair)
|
||||
kerning_pair_node.connect("change", self, "_value_changed")
|
||||
kerning_pair_node.connect("delete", self, "_on_kerning_pair_delete")
|
||||
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_kerning_pair_delete(node):
|
||||
var idx = node.get_index()
|
||||
|
||||
node.queue_free()
|
||||
font_settings.remove_kerning_pair(idx)
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_char_setting_delete(node):
|
||||
var for_char = node.for_char
|
||||
|
||||
node.queue_free()
|
||||
font_settings.remove_setting(for_char)
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _value_changed():
|
||||
emit_signal("change")
|
||||
|
||||
|
||||
func _on_AddCharSettingButton_pressed():
|
||||
_add_char_setting()
|
||||
|
||||
|
||||
func _on_AddKerningButton_pressed():
|
||||
_add_kerning_pair()
|
||||
|
||||
|
||||
func _on_Height_value_changed(value):
|
||||
var font = font_ref.get_ref()
|
||||
if font:
|
||||
font.height = value
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_Gap_value_changed(value):
|
||||
font_settings.gap = value
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_HorizontalAlign_value_changed(value):
|
||||
font_settings.horizontal_align = value
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_Ascent_value_changed(value):
|
||||
var font = font_ref.get_ref()
|
||||
if font:
|
||||
font.ascent = value
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_MonoSpaced_toggled(button_pressed):
|
||||
font_settings.monospace = button_pressed
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_VerticalAlign_value_changed(value):
|
||||
font_settings.vertical_align = value
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_TextEdit_text_changed():
|
||||
font_settings.preview_chars = preview_textbox.text
|
||||
_value_changed()
|
||||
|
||||
|
||||
func _on_Scale_value_changed(value):
|
||||
preview.set_preview_scale(value / 100.0)
|
||||
|
||||
|
||||
func _on_ColorPickerButton_color_changed(color):
|
||||
preview.set_preview_color(color)
|
||||
font_settings.preview_color = color
|
||||
_value_changed()
|
||||
@@ -0,0 +1,6 @@
|
||||
tool
|
||||
extends Button
|
||||
|
||||
|
||||
func _pressed():
|
||||
OS.shell_open("https://github.com/ElectronicBlueberry/Texture-Fonts/wiki")
|
||||
@@ -0,0 +1,30 @@
|
||||
tool
|
||||
extends VBoxContainer
|
||||
|
||||
onready var text_edit := $MarginContainer/TextEdit
|
||||
onready var colorpicker := $HeadingBox/ColorPickerButton
|
||||
|
||||
func set_font(new_font: BitmapFont):
|
||||
text_edit.set("custom_fonts/font", new_font)
|
||||
|
||||
|
||||
func set_preview_text(new_text):
|
||||
if new_text == null: new_text == ""
|
||||
text_edit.text = new_text
|
||||
|
||||
|
||||
func set_preview_color(color: Color):
|
||||
colorpicker.color = color
|
||||
|
||||
var stylebox: StyleBoxFlat = text_edit.get("custom_styles/normal")
|
||||
stylebox.bg_color = color.darkened(0.2)
|
||||
stylebox = text_edit.get("custom_styles/focus")
|
||||
stylebox.bg_color = color
|
||||
|
||||
text_edit.set("custom_colors/caret_color", color.inverted())
|
||||
|
||||
|
||||
func set_preview_scale(scale):
|
||||
text_edit.rect_scale = Vector2(scale, scale)
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
var num_regex := RegEx.new()
|
||||
var unicode_regex := RegEx.new()
|
||||
|
||||
var regex_compiled := false
|
||||
|
||||
# split multi-line string into 2d array containing char codes
|
||||
func chars_to_codes(chars: String) -> Array:
|
||||
var codes = []
|
||||
|
||||
if not regex_compiled:
|
||||
num_regex.compile("[0-9A-Fa-f]+")
|
||||
unicode_regex.compile("\\\\U\\+[0-9A-Fa-f]+;")
|
||||
regex_compiled = true
|
||||
|
||||
var i = 0
|
||||
var l = chars.length()
|
||||
var line = 0
|
||||
|
||||
while i < l:
|
||||
var next_char = chars[i]
|
||||
var code_int = -1
|
||||
|
||||
# dont save new-line smymbol, but switch to new line
|
||||
if next_char == "\n":
|
||||
if line + 1 > codes.size():
|
||||
codes.append([])
|
||||
line += 1
|
||||
i += 1
|
||||
continue
|
||||
# escape char might indicate unicode block
|
||||
elif next_char == "\\":
|
||||
var code = unicode_regex.search(chars, i)
|
||||
if code and code.get_start() == i:
|
||||
var num_code = num_regex.search(code.get_string())
|
||||
code_int = ("0x" + num_code.get_string()).hex_to_int()
|
||||
|
||||
i += code.get_string().length() - 1
|
||||
else:
|
||||
code_int = ord("\\")
|
||||
# standard char
|
||||
else:
|
||||
code_int = ord(next_char)
|
||||
|
||||
# add line, if not present
|
||||
if line + 1 > codes.size():
|
||||
codes.append([code_int])
|
||||
else:
|
||||
codes[line].append(code_int)
|
||||
|
||||
i += 1
|
||||
|
||||
return codes
|
||||
@@ -0,0 +1,9 @@
|
||||
[plugin]
|
||||
|
||||
name="TextureFonts"
|
||||
description="For Godot 3.4+
|
||||
|
||||
Adds a new TextureFont resource, which allows easily creating BitmapFonts from Textures."
|
||||
author="ElectronicBlueberry"
|
||||
version="1.1.0"
|
||||
script="texture_fonts.gd"
|
||||
@@ -0,0 +1,57 @@
|
||||
tool
|
||||
extends EditorPlugin
|
||||
|
||||
|
||||
var _handling_resource: WeakRef
|
||||
var _font_editor: Control
|
||||
var is_disk_resource := false
|
||||
|
||||
func _enter_tree():
|
||||
get_editor_interface().get_resource_filesystem().connect("filesystem_changed", self, "_on_filesystem_changed")
|
||||
|
||||
|
||||
func _exit_tree():
|
||||
close_editor()
|
||||
|
||||
func handles(object: Object) -> bool:
|
||||
if object is BitmapFont and object.get_class() == "TextureFont":
|
||||
return true
|
||||
elif _handling_resource:
|
||||
_handling_resource = null
|
||||
close_editor()
|
||||
|
||||
return false
|
||||
|
||||
func edit(object: Object):
|
||||
var resoruce: BitmapFont = object as BitmapFont
|
||||
_handling_resource = weakref(resoruce)
|
||||
|
||||
if resoruce.resource_path != "":
|
||||
is_disk_resource = true
|
||||
else:
|
||||
is_disk_resource = false
|
||||
|
||||
open_editor(resoruce)
|
||||
|
||||
func open_editor(font: Object):
|
||||
|
||||
if not is_instance_valid(_font_editor):
|
||||
_font_editor = preload("./UI/FontEditor.tscn").instance()
|
||||
add_control_to_bottom_panel(_font_editor, "Texture Font")
|
||||
_font_editor.connect("close", self, "close_editor")
|
||||
|
||||
_font_editor.edit_font(font)
|
||||
make_bottom_panel_item_visible(_font_editor)
|
||||
|
||||
func close_editor():
|
||||
if is_instance_valid(_font_editor):
|
||||
_font_editor.save_now()
|
||||
hide_bottom_panel()
|
||||
remove_control_from_bottom_panel(_font_editor)
|
||||
_font_editor.queue_free()
|
||||
|
||||
func _on_filesystem_changed():
|
||||
if _handling_resource and is_disk_resource:
|
||||
if not _handling_resource.get_ref() or _handling_resource.get_ref().resource_path == "":
|
||||
_handling_resource = null
|
||||
close_editor()
|
||||
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/ColorfulBlockFont.png-d567b0cc89d56be133c8a9bfabd613b4.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/colorful_font/ColorfulBlockFont.png"
|
||||
dest_files=[ "res://.import/ColorfulBlockFont.png-d567b0cc89d56be133c8a9bfabd613b4.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,109 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://examples/colorful_font/ColorfulBlockFont.png" type="Texture" id=1]
|
||||
[ext_resource path="res://examples/colorful_font/colorful_font.tres" type="BitmapFont" id=2]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 0.647059, 0.709804, 0.862745, 1 )
|
||||
|
||||
[node name="ColorfulFont" type="MarginContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 8
|
||||
custom_constants/margin_top = 8
|
||||
custom_constants/margin_left = 8
|
||||
custom_constants/margin_bottom = 8
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Example" type="Control" parent="."]
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 1040.0
|
||||
margin_bottom = 620.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Example"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/separation = 8
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Example/VBoxContainer"]
|
||||
margin_right = 1032.0
|
||||
margin_bottom = 377.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 5.0
|
||||
custom_constants/separation = 8
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Example/VBoxContainer/HBoxContainer"]
|
||||
margin_right = 341.0
|
||||
margin_bottom = 377.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Example/VBoxContainer/HBoxContainer/ColorRect"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource( 1 )
|
||||
stretch_mode = 4
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect2" type="ColorRect" parent="Example/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 349.0
|
||||
margin_right = 1032.0
|
||||
margin_bottom = 377.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Example/VBoxContainer/HBoxContainer/ColorRect2"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = -8.0
|
||||
margin_bottom = -8.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "This Colorful Font is more Fully-Featured,
|
||||
than the simple Number Example.
|
||||
It has 79 different Hand-drawn chars,
|
||||
and shows off many Features of the
|
||||
Font-Editor!
|
||||
|
||||
(like kerning, and char-settings)
|
||||
|
||||
#font #custom_font"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="Example/VBoxContainer"]
|
||||
margin_top = 385.0
|
||||
margin_right = 1032.0
|
||||
margin_bottom = 612.0
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Type something... "
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
[gd_resource type="BitmapFont" load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/Classes/TextureFont.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/texture_fonts/Classes/TextureFontSettings.gd" type="Script" id=2]
|
||||
[ext_resource path="res://examples/colorful_font/ColorfulBlockFont.png" type="Texture" id=3]
|
||||
[ext_resource path="res://addons/texture_fonts/Classes/TextureFontMapping.gd" type="Script" id=4]
|
||||
|
||||
[sub_resource type="Resource" id=1]
|
||||
script = ExtResource( 2 )
|
||||
char_settings = {
|
||||
" ": {
|
||||
"advance": 8,
|
||||
"offset": Vector2( 0, 0 )
|
||||
},
|
||||
"j": {
|
||||
"advance": -4,
|
||||
"offset": Vector2( -4, 8 )
|
||||
},
|
||||
"pgqy": {
|
||||
"advance": 0,
|
||||
"offset": Vector2( 0, 8 )
|
||||
}
|
||||
}
|
||||
kerning_pairs = [ {
|
||||
"from": "fFT",
|
||||
"kerning": 4,
|
||||
"to": "acdegmnopqrsuvwxyz"
|
||||
}, {
|
||||
"from": "gqy",
|
||||
"kerning": -4,
|
||||
"to": "j"
|
||||
} ]
|
||||
gap = 2
|
||||
horizontal_align = 1
|
||||
vertical_align = 0
|
||||
monospace = false
|
||||
preview_color = Color( 1, 1, 1, 1 )
|
||||
preview_chars = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
|
||||
the quick brown fox jumps over the lazy dog
|
||||
0123456789
|
||||
1+1=2
|
||||
2*2=4
|
||||
3/3=1
|
||||
1/4=25%
|
||||
9-4=5
|
||||
some_func(val: String = \"default\");"
|
||||
|
||||
[sub_resource type="Resource" id=2]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 3 )
|
||||
scaled_texture = ExtResource( 3 )
|
||||
rect_size = Vector2( 32, 32 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "ABCDEFGH
|
||||
IJKLMNOP
|
||||
QRSTUVWX
|
||||
YZ?!=/()
|
||||
abcdefgh
|
||||
ijklmnop
|
||||
qrstuvwx
|
||||
yz.,_-:\"
|
||||
01234567
|
||||
89+*#;% "
|
||||
|
||||
[resource]
|
||||
textures = [ ExtResource( 3 ) ]
|
||||
chars = PoolIntArray( 32, 0, 256, 288, 0, 32, 1, 0, 10, 80, 0, 232, 32, 17, 32, 1, 0, 19, 112, 0, 233, 160, 15, 32, 1, 8, 17, 48, 0, 8, 256, 17, 32, 1, 0, 19, 49, 0, 43, 256, 10, 32, 1, 0, 12, 65, 0, 7, 0, 18, 32, 1, 0, 20, 81, 0, 7, 64, 20, 32, 1, 0, 22, 33, 0, 110, 96, 6, 32, 1, 0, 8, 97, 0, 8, 128, 17, 32, 1, 0, 19, 113, 0, 9, 192, 15, 32, 1, 8, 17, 50, 0, 72, 256, 17, 32, 1, 0, 19, 66, 0, 39, 0, 19, 32, 1, 0, 21, 82, 0, 40, 64, 18, 32, 1, 0, 20, 98, 0, 40, 128, 16, 32, 1, 0, 18, 114, 0, 40, 192, 13, 32, 1, 0, 15, 34, 0, 234, 224, 12, 32, 1, 0, 14, 35, 0, 136, 288, 17, 32, 1, 0, 19, 51, 0, 104, 256, 17, 32, 1, 0, 19, 67, 0, 71, 0, 18, 32, 1, 0, 20, 83, 0, 71, 64, 18, 32, 1, 0, 20, 99, 0, 72, 128, 13, 32, 1, 0, 15, 115, 0, 73, 192, 13, 32, 1, 0, 15, 52, 0, 136, 256, 16, 32, 1, 0, 18, 68, 0, 103, 0, 19, 32, 1, 0, 21, 84, 0, 102, 64, 20, 32, 1, 0, 22, 100, 0, 104, 128, 17, 32, 1, 0, 19, 116, 0, 107, 192, 9, 32, 1, 0, 11, 37, 0, 198, 288, 22, 32, 1, 0, 24, 53, 0, 168, 256, 17, 32, 1, 0, 19, 69, 0, 135, 0, 19, 32, 1, 0, 21, 85, 0, 135, 64, 19, 32, 1, 0, 21, 101, 0, 137, 128, 14, 32, 1, 0, 16, 117, 0, 136, 192, 16, 32, 1, 0, 18, 54, 0, 200, 256, 17, 32, 1, 0, 19, 70, 0, 167, 0, 18, 32, 1, 0, 20, 86, 0, 166, 64, 21, 32, 1, 0, 23, 102, 0, 170, 128, 13, 32, 1, 0, 15, 118, 0, 168, 192, 16, 32, 1, 0, 18, 55, 0, 232, 256, 17, 32, 1, 0, 19, 71, 0, 199, 0, 18, 32, 1, 0, 20, 87, 0, 194, 64, 29, 32, 1, 0, 31, 103, 0, 200, 128, 16, 32, 1, 8, 18, 119, 0, 197, 192, 22, 32, 1, 0, 24, 56, 0, 8, 288, 17, 32, 1, 0, 19, 72, 0, 231, 0, 18, 32, 1, 0, 20, 88, 0, 231, 64, 19, 32, 1, 0, 21, 40, 0, 202, 96, 9, 32, 1, 0, 11, 104, 0, 233, 128, 15, 32, 1, 0, 17, 120, 0, 232, 192, 16, 32, 1, 0, 18, 57, 0, 40, 288, 17, 32, 1, 0, 19, 73, 0, 11, 32, 10, 32, 1, 0, 12, 89, 0, 7, 96, 19, 32, 1, 0, 21, 41, 0, 235, 96, 9, 32, 1, 0, 11, 105, 0, 13, 160, 6, 32, 1, 0, 8, 121, 0, 9, 224, 14, 32, 1, 8, 16, 42, 0, 107, 288, 10, 32, 1, 0, 12, 74, 0, 40, 32, 18, 32, 1, 0, 20, 90, 0, 39, 96, 18, 32, 1, 0, 20, 106, 0, 39, 160, 12, 32, -3, 8, 10, 122, 0, 40, 224, 13, 32, 1, 0, 15, 58, 0, 205, 224, 6, 32, 1, 0, 8, 59, 0, 173, 288, 6, 32, 1, 0, 8, 43, 0, 73, 288, 15, 32, 1, 0, 17, 75, 0, 71, 32, 19, 32, 1, 0, 21, 107, 0, 73, 160, 15, 32, 1, 0, 17, 76, 0, 103, 32, 18, 32, 1, 0, 20, 108, 0, 105, 160, 11, 32, 1, 0, 13, 44, 0, 109, 224, 6, 32, 1, 0, 8, 77, 0, 133, 32, 23, 32, 1, 0, 25, 61, 0, 138, 96, 13, 32, 1, 0, 15, 109, 0, 133, 160, 22, 32, 1, 0, 24, 45, 0, 170, 224, 13, 32, 1, 0, 15, 78, 0, 167, 32, 18, 32, 1, 0, 20, 110, 0, 168, 160, 16, 32, 1, 0, 18, 46, 0, 77, 224, 6, 32, 1, 0, 8, 79, 0, 199, 32, 19, 32, 1, 0, 21, 63, 0, 76, 96, 12, 32, 1, 0, 14, 47, 0, 170, 96, 13, 32, 1, 0, 15, 111, 0, 200, 160, 15, 32, 1, 0, 17, 95, 0, 136, 224, 17, 32, 1, 0, 19 )
|
||||
kernings = PoolIntArray( 70, 97, 4, 84, 97, 4, 102, 97, 4, 70, 99, 4, 84, 99, 4, 102, 99, 4, 70, 100, 4, 84, 100, 4, 102, 100, 4, 70, 101, 4, 84, 101, 4, 102, 101, 4, 70, 103, 4, 84, 103, 4, 102, 103, 4, 103, 106, -4, 113, 106, -4, 121, 106, -4, 70, 109, 4, 84, 109, 4, 102, 109, 4, 70, 110, 4, 84, 110, 4, 102, 110, 4, 70, 111, 4, 84, 111, 4, 102, 111, 4, 70, 112, 4, 84, 112, 4, 102, 112, 4, 70, 113, 4, 84, 113, 4, 102, 113, 4, 70, 114, 4, 84, 114, 4, 102, 114, 4, 70, 115, 4, 84, 115, 4, 102, 115, 4, 70, 117, 4, 84, 117, 4, 102, 117, 4, 70, 118, 4, 84, 118, 4, 102, 118, 4, 70, 119, 4, 84, 119, 4, 102, 119, 4, 70, 120, 4, 84, 120, 4, 102, 120, 4, 70, 121, 4, 84, 121, 4, 102, 121, 4, 70, 122, 4, 84, 122, 4, 102, 122, 4 )
|
||||
height = 34.0
|
||||
script = ExtResource( 1 )
|
||||
texture_mappings = [ SubResource( 2 ) ]
|
||||
font_settings = SubResource( 1 )
|
||||
@@ -0,0 +1,191 @@
|
||||
info face="Arial" size=32 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=1,1 outline=0
|
||||
common lineHeight=32 base=0 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4
|
||||
page id=0 file="ArialLatin_0.png"
|
||||
chars count=95
|
||||
char id=32 x=130 y=47 width=5 height=3 xoffset=-2 yoffset=30 xadvance=8 page=0 chnl=15
|
||||
char id=33 x=246 y=69 width=6 height=22 xoffset=1 yoffset=5 xadvance=8 page=0 chnl=15
|
||||
char id=34 x=163 y=111 width=12 height=9 xoffset=-1 yoffset=5 xadvance=10 page=0 chnl=15
|
||||
char id=35 x=60 y=51 width=18 height=22 xoffset=-2 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=36 x=112 y=0 width=17 height=25 xoffset=-1 yoffset=4 xadvance=15 page=0 chnl=15
|
||||
char id=37 x=185 y=0 width=24 height=22 xoffset=0 yoffset=5 xadvance=24 page=0 chnl=15
|
||||
char id=38 x=192 y=23 width=19 height=22 xoffset=0 yoffset=5 xadvance=18 page=0 chnl=15
|
||||
char id=39 x=176 y=111 width=7 height=9 xoffset=-1 yoffset=5 xadvance=5 page=0 chnl=15
|
||||
char id=40 x=53 y=0 width=10 height=27 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15
|
||||
char id=41 x=64 y=0 width=10 height=27 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15
|
||||
char id=42 x=149 y=115 width=13 height=10 xoffset=-1 yoffset=5 xadvance=11 page=0 chnl=15
|
||||
char id=43 x=100 y=115 width=16 height=14 xoffset=0 yoffset=9 xadvance=16 page=0 chnl=15
|
||||
char id=44 x=184 y=111 width=6 height=8 xoffset=1 yoffset=23 xadvance=8 page=0 chnl=15
|
||||
char id=45 x=239 y=110 width=11 height=4 xoffset=-1 yoffset=17 xadvance=9 page=0 chnl=15
|
||||
char id=46 x=100 y=130 width=6 height=4 xoffset=1 yoffset=23 xadvance=8 page=0 chnl=15
|
||||
char id=47 x=0 y=98 width=12 height=22 xoffset=-2 yoffset=5 xadvance=8 page=0 chnl=15
|
||||
char id=48 x=102 y=74 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=49 x=26 y=98 width=11 height=22 xoffset=1 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=50 x=0 y=75 width=16 height=22 xoffset=-1 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=51 x=230 y=69 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=52 x=68 y=74 width=16 height=22 xoffset=-1 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=53 x=182 y=69 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=54 x=85 y=74 width=16 height=22 xoffset=-1 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=55 x=150 y=70 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=56 x=134 y=74 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=57 x=118 y=74 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=58 x=59 y=121 width=6 height=17 xoffset=1 yoffset=10 xadvance=8 page=0 chnl=15
|
||||
char id=59 x=82 y=97 width=6 height=21 xoffset=1 yoffset=10 xadvance=8 page=0 chnl=15
|
||||
char id=60 x=83 y=119 width=16 height=15 xoffset=0 yoffset=9 xadvance=16 page=0 chnl=15
|
||||
char id=61 x=132 y=115 width=16 height=10 xoffset=0 yoffset=11 xadvance=16 page=0 chnl=15
|
||||
char id=62 x=66 y=121 width=16 height=15 xoffset=0 yoffset=9 xadvance=16 page=0 chnl=15
|
||||
char id=63 x=214 y=69 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=64 x=0 y=0 width=28 height=28 xoffset=0 yoffset=5 xadvance=27 page=0 chnl=15
|
||||
char id=65 x=66 y=28 width=21 height=22 xoffset=-2 yoffset=5 xadvance=18 page=0 chnl=15
|
||||
char id=66 x=79 y=51 width=18 height=22 xoffset=0 yoffset=5 xadvance=18 page=0 chnl=15
|
||||
char id=67 x=22 y=29 width=21 height=22 xoffset=0 yoffset=5 xadvance=20 page=0 chnl=15
|
||||
char id=68 x=212 y=23 width=19 height=22 xoffset=1 yoffset=5 xadvance=20 page=0 chnl=15
|
||||
char id=69 x=117 y=51 width=18 height=22 xoffset=0 yoffset=5 xadvance=18 page=0 chnl=15
|
||||
char id=70 x=155 y=47 width=17 height=22 xoffset=1 yoffset=5 xadvance=17 page=0 chnl=15
|
||||
char id=71 x=0 y=29 width=21 height=22 xoffset=0 yoffset=5 xadvance=21 page=0 chnl=15
|
||||
char id=72 x=232 y=23 width=19 height=22 xoffset=0 yoffset=5 xadvance=19 page=0 chnl=15
|
||||
char id=73 x=75 y=97 width=6 height=22 xoffset=1 yoffset=5 xadvance=8 page=0 chnl=15
|
||||
char id=74 x=241 y=46 width=14 height=22 xoffset=-1 yoffset=5 xadvance=13 page=0 chnl=15
|
||||
char id=75 x=109 y=28 width=20 height=22 xoffset=0 yoffset=5 xadvance=18 page=0 chnl=15
|
||||
char id=76 x=173 y=46 width=16 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=77 x=210 y=0 width=22 height=22 xoffset=0 yoffset=5 xadvance=23 page=0 chnl=15
|
||||
char id=78 x=20 y=52 width=19 height=22 xoffset=0 yoffset=5 xadvance=19 page=0 chnl=15
|
||||
char id=79 x=233 y=0 width=22 height=22 xoffset=0 yoffset=5 xadvance=21 page=0 chnl=15
|
||||
char id=80 x=136 y=47 width=18 height=22 xoffset=0 yoffset=5 xadvance=17 page=0 chnl=15
|
||||
char id=81 x=130 y=0 width=23 height=23 xoffset=-1 yoffset=5 xadvance=21 page=0 chnl=15
|
||||
char id=82 x=151 y=24 width=20 height=22 xoffset=1 yoffset=5 xadvance=20 page=0 chnl=15
|
||||
char id=83 x=0 y=52 width=19 height=22 xoffset=-1 yoffset=5 xadvance=18 page=0 chnl=15
|
||||
char id=84 x=98 y=51 width=18 height=22 xoffset=-1 yoffset=5 xadvance=16 page=0 chnl=15
|
||||
char id=85 x=40 y=52 width=19 height=22 xoffset=0 yoffset=5 xadvance=19 page=0 chnl=15
|
||||
char id=86 x=44 y=28 width=21 height=22 xoffset=-2 yoffset=5 xadvance=17 page=0 chnl=15
|
||||
char id=87 x=154 y=0 width=30 height=22 xoffset=-1 yoffset=5 xadvance=28 page=0 chnl=15
|
||||
char id=88 x=130 y=24 width=20 height=22 xoffset=-2 yoffset=5 xadvance=17 page=0 chnl=15
|
||||
char id=89 x=88 y=28 width=20 height=22 xoffset=-1 yoffset=5 xadvance=18 page=0 chnl=15
|
||||
char id=90 x=172 y=23 width=19 height=22 xoffset=-1 yoffset=5 xadvance=17 page=0 chnl=15
|
||||
char id=91 x=95 y=0 width=9 height=27 xoffset=0 yoffset=5 xadvance=8 page=0 chnl=15
|
||||
char id=92 x=38 y=98 width=11 height=22 xoffset=-2 yoffset=5 xadvance=8 page=0 chnl=15
|
||||
char id=93 x=85 y=0 width=9 height=27 xoffset=-1 yoffset=5 xadvance=8 page=0 chnl=15
|
||||
char id=94 x=117 y=115 width=14 height=12 xoffset=-1 yoffset=5 xadvance=12 page=0 chnl=15
|
||||
char id=95 x=219 y=110 width=19 height=4 xoffset=-2 yoffset=28 xadvance=15 page=0 chnl=15
|
||||
char id=96 x=210 y=110 width=8 height=6 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15
|
||||
char id=97 x=188 y=92 width=16 height=17 xoffset=-1 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=98 x=190 y=46 width=16 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=99 x=0 y=121 width=15 height=17 xoffset=-1 yoffset=10 xadvance=14 page=0 chnl=15
|
||||
char id=100 x=207 y=46 width=16 height=22 xoffset=-1 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=101 x=135 y=97 width=17 height=17 xoffset=-1 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=102 x=13 y=98 width=12 height=22 xoffset=-2 yoffset=5 xadvance=7 page=0 chnl=15
|
||||
char id=103 x=224 y=46 width=16 height=22 xoffset=-1 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=104 x=166 y=70 width=15 height=22 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15
|
||||
char id=105 x=61 y=98 width=6 height=22 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=15
|
||||
char id=106 x=75 y=0 width=9 height=27 xoffset=-3 yoffset=5 xadvance=6 page=0 chnl=15
|
||||
char id=107 x=198 y=69 width=15 height=22 xoffset=0 yoffset=5 xadvance=14 page=0 chnl=15
|
||||
char id=108 x=68 y=97 width=6 height=22 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=15
|
||||
char id=109 x=89 y=97 width=22 height=17 xoffset=0 yoffset=10 xadvance=22 page=0 chnl=15
|
||||
char id=110 x=205 y=92 width=15 height=17 xoffset=0 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=111 x=153 y=93 width=17 height=17 xoffset=-1 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=112 x=17 y=75 width=16 height=22 xoffset=0 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=113 x=34 y=75 width=16 height=22 xoffset=-1 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=114 x=47 y=121 width=11 height=17 xoffset=0 yoffset=10 xadvance=9 page=0 chnl=15
|
||||
char id=115 x=171 y=93 width=16 height=17 xoffset=-1 yoffset=10 xadvance=14 page=0 chnl=15
|
||||
char id=116 x=50 y=98 width=10 height=22 xoffset=-1 yoffset=5 xadvance=8 page=0 chnl=15
|
||||
char id=117 x=221 y=92 width=15 height=17 xoffset=0 yoffset=10 xadvance=15 page=0 chnl=15
|
||||
char id=118 x=237 y=92 width=15 height=17 xoffset=-1 yoffset=10 xadvance=13 page=0 chnl=15
|
||||
char id=119 x=112 y=97 width=22 height=17 xoffset=-2 yoffset=10 xadvance=19 page=0 chnl=15
|
||||
char id=120 x=32 y=121 width=14 height=17 xoffset=-1 yoffset=10 xadvance=12 page=0 chnl=15
|
||||
char id=121 x=51 y=75 width=16 height=22 xoffset=-1 yoffset=10 xadvance=14 page=0 chnl=15
|
||||
char id=122 x=16 y=121 width=15 height=17 xoffset=-1 yoffset=10 xadvance=13 page=0 chnl=15
|
||||
char id=123 x=41 y=0 width=11 height=27 xoffset=-1 yoffset=5 xadvance=9 page=0 chnl=15
|
||||
char id=124 x=105 y=0 width=6 height=27 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=15
|
||||
char id=125 x=29 y=0 width=11 height=27 xoffset=-1 yoffset=5 xadvance=9 page=0 chnl=15
|
||||
char id=126 x=191 y=110 width=18 height=6 xoffset=-1 yoffset=13 xadvance=16 page=0 chnl=15
|
||||
kernings count=91
|
||||
kerning first=32 second=65 amount=-2
|
||||
kerning first=32 second=84 amount=-1
|
||||
kerning first=32 second=89 amount=-1
|
||||
kerning first=121 second=46 amount=-2
|
||||
kerning first=121 second=44 amount=-2
|
||||
kerning first=119 second=46 amount=-2
|
||||
kerning first=119 second=44 amount=-2
|
||||
kerning first=118 second=46 amount=-2
|
||||
kerning first=118 second=44 amount=-2
|
||||
kerning first=114 second=46 amount=-2
|
||||
kerning first=49 second=49 amount=-2
|
||||
kerning first=65 second=32 amount=-2
|
||||
kerning first=65 second=84 amount=-2
|
||||
kerning first=65 second=86 amount=-2
|
||||
kerning first=65 second=87 amount=-1
|
||||
kerning first=65 second=89 amount=-2
|
||||
kerning first=65 second=118 amount=-1
|
||||
kerning first=65 second=119 amount=-1
|
||||
kerning first=65 second=121 amount=-1
|
||||
kerning first=114 second=44 amount=-2
|
||||
kerning first=70 second=44 amount=-3
|
||||
kerning first=70 second=46 amount=-3
|
||||
kerning first=70 second=65 amount=-2
|
||||
kerning first=76 second=32 amount=-1
|
||||
kerning first=76 second=84 amount=-2
|
||||
kerning first=76 second=86 amount=-2
|
||||
kerning first=76 second=87 amount=-2
|
||||
kerning first=76 second=89 amount=-2
|
||||
kerning first=76 second=121 amount=-1
|
||||
kerning first=102 second=102 amount=-1
|
||||
kerning first=80 second=32 amount=-1
|
||||
kerning first=80 second=44 amount=-4
|
||||
kerning first=80 second=46 amount=-4
|
||||
kerning first=80 second=65 amount=-2
|
||||
kerning first=82 second=84 amount=-1
|
||||
kerning first=82 second=86 amount=-1
|
||||
kerning first=82 second=87 amount=-1
|
||||
kerning first=82 second=89 amount=-1
|
||||
kerning first=84 second=32 amount=-1
|
||||
kerning first=84 second=44 amount=-3
|
||||
kerning first=84 second=45 amount=-2
|
||||
kerning first=84 second=46 amount=-3
|
||||
kerning first=84 second=58 amount=-3
|
||||
kerning first=89 second=118 amount=-2
|
||||
kerning first=84 second=65 amount=-2
|
||||
kerning first=84 second=79 amount=-1
|
||||
kerning first=84 second=97 amount=-3
|
||||
kerning first=84 second=99 amount=-3
|
||||
kerning first=84 second=101 amount=-3
|
||||
kerning first=84 second=105 amount=-1
|
||||
kerning first=84 second=111 amount=-3
|
||||
kerning first=84 second=114 amount=-1
|
||||
kerning first=84 second=115 amount=-3
|
||||
kerning first=84 second=117 amount=-1
|
||||
kerning first=84 second=119 amount=-2
|
||||
kerning first=84 second=121 amount=-2
|
||||
kerning first=86 second=44 amount=-3
|
||||
kerning first=86 second=45 amount=-2
|
||||
kerning first=86 second=46 amount=-3
|
||||
kerning first=86 second=58 amount=-1
|
||||
kerning first=89 second=117 amount=-2
|
||||
kerning first=86 second=65 amount=-2
|
||||
kerning first=86 second=97 amount=-2
|
||||
kerning first=86 second=101 amount=-2
|
||||
kerning first=86 second=105 amount=-1
|
||||
kerning first=86 second=111 amount=-2
|
||||
kerning first=86 second=114 amount=-1
|
||||
kerning first=86 second=117 amount=-1
|
||||
kerning first=86 second=121 amount=-1
|
||||
kerning first=87 second=44 amount=-2
|
||||
kerning first=87 second=45 amount=-1
|
||||
kerning first=87 second=46 amount=-2
|
||||
kerning first=87 second=58 amount=-1
|
||||
kerning first=89 second=113 amount=-3
|
||||
kerning first=87 second=65 amount=-1
|
||||
kerning first=87 second=97 amount=-1
|
||||
kerning first=87 second=101 amount=-1
|
||||
kerning first=89 second=112 amount=-2
|
||||
kerning first=87 second=111 amount=-1
|
||||
kerning first=87 second=114 amount=-1
|
||||
kerning first=87 second=117 amount=-1
|
||||
kerning first=89 second=111 amount=-3
|
||||
kerning first=89 second=32 amount=-1
|
||||
kerning first=89 second=44 amount=-4
|
||||
kerning first=89 second=45 amount=-3
|
||||
kerning first=89 second=46 amount=-4
|
||||
kerning first=89 second=58 amount=-2
|
||||
kerning first=89 second=105 amount=-1
|
||||
kerning first=89 second=65 amount=-2
|
||||
kerning first=89 second=97 amount=-2
|
||||
kerning first=89 second=101 amount=-3
|
||||
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/ArialLatin_0.png-ed0844194d35061046286a6168679690.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/ArialLatin_0.png"
|
||||
dest_files=[ "res://.import/ArialLatin_0.png-ed0844194d35061046286a6168679690.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,41 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://examples/emoji/emoji_font.tres" type="BitmapFont" id=1]
|
||||
|
||||
[node name="Emoji" type="MarginContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
margin_right = 1048.0
|
||||
margin_bottom = 628.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Panel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = -8.0
|
||||
margin_bottom = -8.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "☼● This are emojis ◌
|
||||
|
||||
Well, only sort of. Godot 3 can only display unicode smybols up to \\U+FFFF; ☺
|
||||
|
||||
But we can replace any other unicode symbol, to \"fake\" emojis ○
|
||||
|
||||
This font uses a simple ArialLatin BitMap Font as a fallback and overrides
|
||||
seldomly used characters with \"emojis\" from Twemoji ☼☼☼
|
||||
|
||||
If you ♥ emojis, you'll ☻ this feature"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
[gd_resource type="BitmapFont" load_steps=20 format=2]
|
||||
|
||||
[ext_resource path="res://addons/texture_fonts/Classes/TextureFont.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/texture_fonts/Classes/TextureFontSettings.gd" type="Script" id=2]
|
||||
[ext_resource path="res://examples/emoji/emojis/1f60d.svg" type="Texture" id=3]
|
||||
[ext_resource path="res://addons/texture_fonts/Classes/TextureFontMapping.gd" type="Script" id=4]
|
||||
[ext_resource path="res://examples/emoji/ArialLatin.fnt" type="BitmapFont" id=5]
|
||||
[ext_resource path="res://examples/emoji/emojis/1f92f.svg" type="Texture" id=6]
|
||||
[ext_resource path="res://examples/emoji/emojis/1f448.svg" type="Texture" id=7]
|
||||
[ext_resource path="res://examples/emoji/emojis/1f62e.svg" type="Texture" id=8]
|
||||
[ext_resource path="res://examples/emoji/emojis/2764.svg" type="Texture" id=9]
|
||||
[ext_resource path="res://examples/emoji/emojis/1f525.svg" type="Texture" id=10]
|
||||
[ext_resource path="res://examples/emoji/emojis/1f622.svg" type="Texture" id=11]
|
||||
|
||||
[sub_resource type="Resource" id=1]
|
||||
script = ExtResource( 2 )
|
||||
char_settings = {
|
||||
}
|
||||
kerning_pairs = [ ]
|
||||
gap = 2
|
||||
horizontal_align = 1
|
||||
vertical_align = 0
|
||||
monospace = false
|
||||
preview_color = Color( 0.12549, 0.141176, 0.192157, 1 )
|
||||
preview_chars = ""
|
||||
|
||||
[sub_resource type="Resource" id=2]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 3 )
|
||||
scaled_texture = ExtResource( 3 )
|
||||
rect_size = Vector2( 36, 36 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "\\U+263b;"
|
||||
|
||||
[sub_resource type="Resource" id=3]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 8 )
|
||||
scaled_texture = ExtResource( 8 )
|
||||
rect_size = Vector2( 36, 36 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "\\U+25cb;"
|
||||
|
||||
[sub_resource type="Resource" id=4]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 6 )
|
||||
scaled_texture = ExtResource( 6 )
|
||||
rect_size = Vector2( 36, 36 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "\\U+25cc;"
|
||||
|
||||
[sub_resource type="Resource" id=5]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 7 )
|
||||
scaled_texture = ExtResource( 7 )
|
||||
rect_size = Vector2( 36, 36 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "\\U+25cf;"
|
||||
|
||||
[sub_resource type="Resource" id=6]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 10 )
|
||||
scaled_texture = ExtResource( 10 )
|
||||
rect_size = Vector2( 36, 36 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "\\U+263c;"
|
||||
|
||||
[sub_resource type="Resource" id=7]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 9 )
|
||||
scaled_texture = ExtResource( 9 )
|
||||
rect_size = Vector2( 36, 36 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "\\U+2665;"
|
||||
|
||||
[sub_resource type="Resource" id=8]
|
||||
script = ExtResource( 4 )
|
||||
source_texture = ExtResource( 11 )
|
||||
scaled_texture = ExtResource( 11 )
|
||||
rect_size = Vector2( 36, 36 )
|
||||
rect_gap = Vector2( 0, 0 )
|
||||
texture_offset = Vector2( 0, 0 )
|
||||
scale = 1
|
||||
interpolation = 0
|
||||
chars = "\\U+263a;"
|
||||
|
||||
[resource]
|
||||
textures = [ ExtResource( 3 ), ExtResource( 8 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 10 ), ExtResource( 9 ), ExtResource( 11 ) ]
|
||||
chars = PoolIntArray( 9786, 6, 0, 0, 36, 36, 1, 0, 38, 9675, 1, 0, 0, 36, 36, 1, 0, 38, 9787, 0, 0, 0, 36, 36, 1, 0, 38, 9788, 4, 1, 0, 34, 36, 1, 0, 36, 9676, 2, 1, 0, 34, 36, 1, 0, 36, 9829, 5, 0, 0, 36, 36, 1, 0, 38, 9679, 3, 0, 0, 36, 36, 1, 0, 38 )
|
||||
height = 36.0
|
||||
ascent = 4.0
|
||||
fallback = ExtResource( 5 )
|
||||
script = ExtResource( 1 )
|
||||
texture_mappings = [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ]
|
||||
font_settings = SubResource( 1 )
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFDC5D" d="M20.145 31s-2.436-.167-3.068-1.792c-.646-1.659.622-2.309.622-2.309s-1.914.059-2.622-1.941c-.668-1.885.958-2.75.958-2.75s-1.871-.307-2.417-2.292C13.158 18.245 14.784 17 14.784 17H2.576C1.617 17 .001 16.458 0 14.457-.002 12.457 1.659 12 2.576 12h20.5c1 0 1-1 0-1H20.41c-3.792 0-6.143-2.038-6.792-2.751-.65-.713-.98-1.667-.734-2.82.415-1.956 1.92-1.529 3.197-.975 3.078 1.337 7.464 2.254 9.538 2.533 5.858.791 10.375 5.809 10.381 11.884.004 6.626-5.298 12.124-11.924 12.129h-3.931z"/></svg>
|
||||
|
After Width: | Height: | Size: 571 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/1f448.svg-a8b0fe752e696ea28ffb5fc32e130e9e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/emojis/1f448.svg"
|
||||
dest_files=[ "res://.import/1f448.svg-a8b0fe752e696ea28ffb5fc32e130e9e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#F4900C" d="M35 19c0-2.062-.367-4.039-1.04-5.868-.46 5.389-3.333 8.157-6.335 6.868-2.812-1.208-.917-5.917-.777-8.164.236-3.809-.012-8.169-6.931-11.794 2.875 5.5.333 8.917-2.333 9.125-2.958.231-5.667-2.542-4.667-7.042-3.238 2.386-3.332 6.402-2.333 9 1.042 2.708-.042 4.958-2.583 5.208-2.84.28-4.418-3.041-2.963-8.333C2.52 10.965 1 14.805 1 19c0 9.389 7.611 17 17 17s17-7.611 17-17z"/><path fill="#FFCC4D" d="M28.394 23.999c.148 3.084-2.561 4.293-4.019 3.709-2.106-.843-1.541-2.291-2.083-5.291s-2.625-5.083-5.708-6c2.25 6.333-1.247 8.667-3.08 9.084-1.872.426-3.753-.001-3.968-4.007C7.352 23.668 6 26.676 6 30c0 .368.023.73.055 1.09C9.125 34.124 13.342 36 18 36s8.875-1.876 11.945-4.91c.032-.36.055-.722.055-1.09 0-2.187-.584-4.236-1.606-6.001z"/></svg>
|
||||
|
After Width: | Height: | Size: 822 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/1f525.svg-247568a919ac840fa25984353acd1841.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/emojis/1f525.svg"
|
||||
dest_files=[ "res://.import/1f525.svg-247568a919ac840fa25984353acd1841.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M36 18c0 9.941-8.059 18-18 18S0 27.941 0 18 8.059 0 18 0s18 8.059 18 18"/><path fill="#664500" d="M18 21.849c-2.966 0-4.935-.346-7.369-.819-.557-.106-1.638 0-1.638 1.638 0 3.275 3.763 7.369 9.007 7.369s9.007-4.094 9.007-7.369c0-1.638-1.082-1.745-1.638-1.638-2.434.473-4.402.819-7.369.819"/><path fill="#DD2E44" d="M16.65 3.281C15.791.85 13.126-.426 10.694.431c-1.476.52-2.521 1.711-2.928 3.104-1.191-.829-2.751-1.1-4.225-.58C1.111 3.813-.167 6.48.692 8.911c.122.344.284.663.472.958 1.951 3.582 7.588 6.1 11.001 6.131 2.637-2.167 5.446-7.665 4.718-11.677-.038-.348-.113-.698-.233-1.042zm2.7 0C20.209.85 22.875-.426 25.306.431c1.476.52 2.521 1.711 2.929 3.104 1.191-.829 2.751-1.1 4.225-.58 2.43.858 3.707 3.525 2.85 5.956-.123.344-.284.663-.473.958-1.951 3.582-7.588 6.1-11.002 6.131-2.637-2.167-5.445-7.665-4.717-11.677.037-.348.112-.698.232-1.042z"/></svg>
|
||||
|
After Width: | Height: | Size: 941 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/1f60d.svg-3ccd458245425e9cf777e56b5f46dbc8.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/emojis/1f60d.svg"
|
||||
dest_files=[ "res://.import/1f60d.svg-3ccd458245425e9cf777e56b5f46dbc8.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"/><ellipse fill="#664500" cx="11.5" cy="17" rx="2.5" ry="3.5"/><ellipse fill="#664500" cx="24.5" cy="17" rx="2.5" ry="3.5"/><path fill="#664500" d="M5.999 13.5c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4 3.262-4.35 7.616-4.4 7.8-4.4.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.641-3.521-6.061-3.599-6.206-3.6-.55-.006-.994-.456-.991-1.005.003-.551.447-.995.997-.995.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-6.516 14.879C23.474 28.335 22.34 24 18 24s-5.474 4.335-5.485 4.379c-.053.213.044.431.232.544.188.112.433.086.596-.06C13.352 28.855 14.356 28 18 28c3.59 0 4.617.83 4.656.863.095.09.219.137.344.137.084 0 .169-.021.246-.064.196-.112.294-.339.239-.557z"/><path fill="#5DADEC" d="M16 31c0 2.762-2.238 5-5 5s-5-2.238-5-5 4-10 5-10 5 7.238 5 10z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/1f622.svg-bdc8a3fdf5a630d3ffb6209ccd7cb7ad.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/emojis/1f622.svg"
|
||||
dest_files=[ "res://.import/1f622.svg-bdc8a3fdf5a630d3ffb6209ccd7cb7ad.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M36 18c0 9.941-8.059 18-18 18S0 27.941 0 18 8.059 0 18 0s18 8.059 18 18"/><ellipse fill="#664500" cx="18" cy="25" rx="4" ry="5"/><ellipse fill="#664500" cx="12" cy="13.5" rx="2.5" ry="3.5"/><ellipse fill="#664500" cx="24" cy="13.5" rx="2.5" ry="3.5"/></svg>
|
||||
|
After Width: | Height: | Size: 341 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/1f62e.svg-e44150e8f375ccf49ee6f0191a5e2da3.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/emojis/1f62e.svg"
|
||||
dest_files=[ "res://.import/1f62e.svg-e44150e8f375ccf49ee6f0191a5e2da3.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCB4C" d="M35 18.619c0-3.794-3.075-6.869-6.869-6.869-.979 0-2.752.578-2.752.578l-13.126 1.384s-2.717-1.581-4.383-1.581C4.075 12.131 1 15.206 1 19c0 .237.012.471.035.702C1.406 28.763 8.849 36 18 36c9.389 0 17-7.611 17-17 0-.052-.009-.101-.012-.153.003-.076.012-.151.012-.228z"/><path fill="#F19020" d="M30.126 13.751c-.941-.244-1.009.386-2.202.246-1.168-.137.429-.739-.195-1.092-.21-.119-.511-.144-.882-.098-1.052.129-16.954.544-17.547.83-.527.254-.839.548-1.318.101-.603-.562-1.466-.238-1.716-.051-.322.242-.389.722.234 1.277.621.42 1.673.859 3.465 1.159.197.033.365.046.522.052 1.227.041 1.397-1.67 3.13-1.716 1.136-.03 11.153 1.07 11.978.958.101-.014.207-.024.329-.024 1.563 0 1.926 1.45 3.589.316.705-.573 1.811-1.648.613-1.958z"/><path fill="#F36C24" d="M5.938 9.115c1.523 1.527 2.604 3.145 3.362 4.523.566 1.029.956 1.929 1.187 2.538 1.227.041 1.397-.67 3.13-.716 1.136-.03 1.783.769 2.623 1.229 1.502.822 2.569-.73 3.719-.73.85 0 2.219 1.207 3.176.764 1.387-.643 1.635-1.191 2.46-1.304.322-.791.741-1.696 1.252-2.609.74-1.324 1.678-2.665 2.841-3.693H5.938z"/><path fill="#CE5C1F" d="M29.306 9.435c1.281-1.263-23.039.016-22.341.788.988 1.094 2.2 3.153 2.2 3.153s4.757 2.405 8.351-.626c2.5 1.5 6 .969 7.562-1.609 0 0 1.217.453 2.451.531 0 0 .953-1.425 1.777-2.237z"/><ellipse fill="#65471B" cx="18" cy="28.638" rx="4.332" ry="4.95"/><path fill="#65471B" d="M14 20.606c0 1.473-.896 2.667-2 2.667-1.105 0-2-1.194-2-2.667 0-1.473.895-2.667 2-2.667 1.104 0 2 1.194 2 2.667zm12-.001c0 1.473-.895 2.667-2 2.667s-2-1.194-2-2.667c0-1.472.896-2.667 2-2.667 1.105.001 2 1.195 2 2.667z"/><path fill="#CCD6DD" d="M31.125 3.725c-.24 0-.467.045-.686.109-.688-.845-1.723-1.396-2.898-1.396-.087 0-.169.02-.255.026-.734-.827-1.794-1.359-2.987-1.359-1.505 0-2.8.839-3.486 2.066-.346-.798-1.139-1.357-2.064-1.357-.718 0-1.349.342-1.761.865C16.48 1.209 15.1.147 13.458.147c-1.323 0-2.48.689-3.148 1.723-.184-.029-.368-.058-.56-.058-1.432 0-2.661.812-3.293 1.992-.203-.038-.41-.063-.624-.063-1.864 0-3.375 1.511-3.375 3.375s1.511 3.375 3.375 3.375c.588 0 1.135-.159 1.614-.425.376.282.838.456 1.345.456.145 0 .285-.016.422-.043.855 1.379 2.367 2.303 4.109 2.303 1.709 0 3.206-.885 4.073-2.217.72.882 1.802 1.457 3.029 1.457 1.815 0 3.327-1.238 3.776-2.911.034.001.065.01.099.01.283 0 .559-.031.826-.087.654.556 1.491.904 2.417.904 1.174 0 2.21-.551 2.897-1.396.219.064.446.109.686.109 1.36 0 2.463-1.103 2.463-2.463s-1.104-2.463-2.464-2.463z"/><circle fill="#E1E8ED" cx="27.795" cy="5.767" r="2.121"/><path fill="#E1E8ED" d="M19.876 5.903c0-1.193-.967-2.161-2.16-2.161-.368 0-.71.101-1.013.263-.251-.601-.844-1.024-1.537-1.024-.567 0-1.067.285-1.368.718-.67-.623-1.561-1.013-2.548-1.013-1.755 0-3.216 1.21-3.625 2.838-.365-.367-.87-.595-1.429-.595-1.111 0-2.012.901-2.012 2.012s.901 2.012 2.012 2.012c.703 0 1.319-.361 1.679-.907.517 1.081 1.529 1.873 2.749 2.079.39.67 1.107 1.125 1.938 1.125 1.074 0 1.969-.754 2.193-1.76.324.18.691.292 1.087.292 1.07 0 1.962-.749 2.19-1.75 1.042-.155 1.844-1.044 1.844-2.129z"/></svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/1f92f.svg-513c3e7a70a2a49ea5095516e27d3f5f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/emojis/1f92f.svg"
|
||||
dest_files=[ "res://.import/1f92f.svg-513c3e7a70a2a49ea5095516e27d3f5f.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#DD2E44" d="M35.885 11.833c0-5.45-4.418-9.868-9.867-9.868-3.308 0-6.227 1.633-8.018 4.129-1.791-2.496-4.71-4.129-8.017-4.129-5.45 0-9.868 4.417-9.868 9.868 0 .772.098 1.52.266 2.241C1.751 22.587 11.216 31.568 18 34.034c6.783-2.466 16.249-11.447 17.617-19.959.17-.721.268-1.469.268-2.242z"/></svg>
|
||||
|
After Width: | Height: | Size: 368 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/2764.svg-9145c72aa2a8a3e4e393620c2c61d72f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/emoji/emojis/2764.svg"
|
||||
dest_files=[ "res://.import/2764.svg-9145c72aa2a8a3e4e393620c2c61d72f.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,36 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://examples/numbers/Numbers.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://examples/colorful_font/ColorfulFont.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://examples/emoji/emoji.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="Showcase" type="TabContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = -8.0
|
||||
margin_bottom = -8.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Numbers" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = 4.0
|
||||
margin_top = 32.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
|
||||
[node name="ColorfulFont" parent="." instance=ExtResource( 2 )]
|
||||
visible = false
|
||||
margin_left = 4.0
|
||||
margin_top = 32.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
|
||||
[node name="Emoji" parent="." instance=ExtResource( 3 )]
|
||||
visible = false
|
||||
margin_left = 4.0
|
||||
margin_top = 32.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/CostFontSheet.png-3e8fa87667ed5ec3b2cb48c7957a96f9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/numbers/CostFontSheet.png"
|
||||
dest_files=[ "res://.import/CostFontSheet.png-3e8fa87667ed5ec3b2cb48c7957a96f9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,142 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://examples/numbers/CostFontSheet.png" type="Texture" id=1]
|
||||
[ext_resource path="res://examples/numbers/cost_font.tres" type="BitmapFont" id=2]
|
||||
|
||||
[node name="Numbers" type="MarginContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 8
|
||||
custom_constants/margin_top = 8
|
||||
custom_constants/margin_left = 8
|
||||
custom_constants/margin_bottom = 8
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Example" type="Control" parent="."]
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 1040.0
|
||||
margin_bottom = 620.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="Example"]
|
||||
margin_right = 401.0
|
||||
margin_bottom = 48.0
|
||||
text = "Number Font made to display the cost of cards in a card-game.
|
||||
|
||||
It is monospaced for easier alignment.
|
||||
|
||||
Source Texture:"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Example"]
|
||||
margin_top = 93.0
|
||||
margin_right = 122.0
|
||||
margin_bottom = 105.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Example/ColorRect"]
|
||||
margin_right = 122.0
|
||||
margin_bottom = 12.0
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Card" type="ColorRect" parent="Example"]
|
||||
margin_left = 45.123
|
||||
margin_top = 256.287
|
||||
margin_right = 192.123
|
||||
margin_bottom = 462.287
|
||||
rect_rotation = -15.0
|
||||
color = Color( 0.94902, 0.305882, 0.305882, 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Example/Card"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 34.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "1"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Card2" type="ColorRect" parent="Example"]
|
||||
margin_left = 144.825
|
||||
margin_top = 197.597
|
||||
margin_right = 291.825
|
||||
margin_bottom = 403.597
|
||||
color = Color( 0.305882, 0.435294, 0.94902, 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Example/Card2"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 34.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "2"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Card3" type="ColorRect" parent="Example"]
|
||||
margin_left = 267.155
|
||||
margin_top = 225.174
|
||||
margin_right = 414.155
|
||||
margin_bottom = 431.174
|
||||
rect_rotation = 15.0
|
||||
color = Color( 0.305882, 0.94902, 0.435294, 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Example/Card3"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "3"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label2" type="Label" parent="Example"]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -486.0
|
||||
margin_top = 234.0
|
||||
margin_bottom = 342.0
|
||||
text = "The font uses the built in texture up-sacling set to nearest.
|
||||
The up-scaler keeps the textures import flags,
|
||||
regardless of the up-scaling method used.
|
||||
|
||||
This allows the font to be filterd, yet keep a pixel-art look."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect2" type="ColorRect" parent="Example"]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -480.0
|
||||
margin_bottom = 40.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Example/ColorRect2"]
|
||||
margin_right = 480.0
|
||||
margin_bottom = 40.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "01234567890%"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,38 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ {
|
||||
"base": "BitmapFont",
|
||||
"class": "TextureFont",
|
||||
"language": "GDScript",
|
||||
"path": "res://addons/texture_fonts/Classes/TextureFont.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"TextureFont": "res://addons/texture_fonts/Assets/TextureFont.svg"
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Texture Fonts"
|
||||
run/main_scene="res://examples/example_showcase.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=1048
|
||||
window/size/height=628
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PoolStringArray( "res://addons/texture_fonts/plugin.cfg" )
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||