Skip to content

Commit

Permalink
Merge pull request #166 from fleskesvor/utf-8-font
Browse files Browse the repository at this point in the history
  • Loading branch information
fleskesvor authored May 22, 2018
2 parents b3e69f1 + ecbb13e commit 933e949
Show file tree
Hide file tree
Showing 15 changed files with 266 additions and 91 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ as described in the LICENSE.md file.
License CC0, [distributed on OpenGameArt](http://opengameart.org/content/cartoon-characters-and-objects-vector-pack)
- [Clint Bellanger](http://clintbellanger.net) - Recycle items set, License CC BY 3.0,
[distributed on OpenGameArt](http://opengameart.org/content/recycle-items-set)

### Font

The [Noto font](https://www.google.com/get/noto/) is a trademark of Google Inc., and is available under the SIL Open Font License, version 1.1.
Binary file not shown.
Binary file added device/demo/ui/dd_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions device/demo/ui/dd_background.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/dd_background.png-64455d0cae41512fd268622c2df4b837.stex"

[deps]

source_file="res://demo/ui/dd_background.png"
source_md5="eb05b069e161620b0e759edd3b3091ea"

dest_files=[ "res://.import/dd_background.png-64455d0cae41512fd268622c2df4b837.stex" ]
dest_md5="102ac34dffa3ad96f81d7c422c9ff96d"

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
92 changes: 37 additions & 55 deletions device/demo/ui/dd_default.tscn
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=6 format=2]

[ext_resource path="res://globals/dialog_dialog.gd" type="Script" id=1]
[ext_resource path="res://demo/ui/dd_background.png" type="Texture" id=2]
[ext_resource path="res://demo/ui/dialog_theme.tres" type="Theme" id=3]

[sub_resource type="Animation" id=1]

resource_name = "hide"
length = 0.75
loop = false
step = 0.05
Expand Down Expand Up @@ -77,49 +78,44 @@ tracks/2/keys = {

[node name="dialog" type="Control" index="0"]

anchor_left = 0.0
anchor_left = 0.5
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 539.0
margin_top = 398.0
margin_right = -58.0
margin_bottom = -203.0
anchor_right = 0.5
anchor_bottom = 0.0
margin_left = -450.0
margin_top = 150.0
margin_right = -450.0
margin_bottom = 200.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 2
script = ExtResource( 1 )
__meta__ = {
"__editor_plugin_screen__": "2D"
}
mouse_enter_color = Color( 1, 1, 0.3, 1 )
mouse_enter_shadow_color = Color( 0.6, 0.4, 0, 1 )
mouse_exit_color = Color( 1, 1, 1, 1 )
mouse_exit_shadow_color = Color( 1, 1, 1, 1 )

[node name="anchor" type="Node2D" parent="." index="0"]

position = Vector2( 373.302, 425.803 )

[node name="bg" type="TextureRect" parent="anchor" index="0"]

modulate = Color( 0, 0, 0, 0.392157 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = -937.0
margin_top = -377.0
margin_right = 985.0
margin_bottom = 138.0
margin_right = 900.0
margin_bottom = 400.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 2
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 2 )
expand = true
stretch_mode = 0

Expand All @@ -129,11 +125,10 @@ anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = -735.0
margin_top = -334.0
margin_right = 893.0
margin_bottom = -105.0
rect_min_size = Vector2( 1628, 229 )
margin_left = 50.0
margin_top = 50.0
margin_right = 850.0
margin_bottom = 350.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
mouse_filter = 0
Expand All @@ -151,14 +146,12 @@ anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1628.0
margin_bottom = 229.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/separation = 10
alignment = 0

Expand All @@ -176,31 +169,28 @@ anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = -338.0
margin_top = 134.0
margin_right = 1270.0
margin_bottom = 163.0
rect_min_size = Vector2( 800, 29 )
margin_bottom = 35.0
rect_min_size = Vector2( 0, 35 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 2
size_flags_horizontal = 1
size_flags_vertical = 1

[node name="button" type="TextureButton" parent="item" index="0"]

anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 2
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
Expand All @@ -212,22 +202,14 @@ anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 25.0
margin_top = 3.0
margin_right = 1605.0
margin_bottom = 36.0
rect_min_size = Vector2( 1580, 33 )
margin_bottom = 14.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 0
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
text = "I should pick option one"
valign = 1
autowrap = true
size_flags_horizontal = 1
size_flags_vertical = 4
theme = ExtResource( 3 )
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]

[ext_resource path="res://globals/dialog_instance.gd" type="Script" id=1]
[ext_resource path="res://demo/ui/dialog_theme.tres" type="Theme" id=2]


[node name="dialog_instance" type="Container"]

anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 1 )
__meta__ = {
"__editor_plugin_screen__": "2D"
Expand All @@ -14,8 +26,20 @@ fixed_pos = false

[node name="anchor" type="Container" parent="." index="0"]

anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1

[node name="text" type="RichTextLabel" parent="anchor" index="0"]

modulate = Color( 0, 0, 0, 1 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
Expand All @@ -30,10 +54,8 @@ mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 2
custom_colors/default_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_selected = Color( 0, 0, 0, 1 )
custom_constants/line_separation = -5
bbcode_enabled = false
theme = ExtResource( 2 )
bbcode_enabled = true
bbcode_text = ""
visible_characters = -1
percent_visible = 1.0
Expand Down
17 changes: 17 additions & 0 deletions device/demo/ui/dialog_theme.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[gd_resource type="Theme" load_steps=3 format=2]

[sub_resource type="DynamicFontData" id=1]

font_path = "res://ui/fonts/NotoSans-Regular.ttf"

[sub_resource type="DynamicFont" id=2]

size = 12
use_mipmaps = false
use_filter = false
font_data = SubResource( 1 )

[resource]

default_font = SubResource( 2 )

5 changes: 2 additions & 3 deletions device/globals/dialog_dialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,14 @@ func start(params, p_context):

label.set_text(text)
but.connect("pressed", self, "selected", [i])
but.connect("mouse_entered",self,"_on_mouse_enter",[but])
but.connect("mouse_exited",self,"_on_mouse_exit",[but])
label.connect("mouse_entered", self, "_on_mouse_enter", [but])
label.connect("mouse_exited", self, "_on_mouse_exit", [but])

var height_ratio = ProjectSettings.get_setting("escoria/platform/dialog_option_height")
var size = it.get_custom_minimum_size()
size.y = size.y * height_ratio
it.set_custom_minimum_size(size)


container.add_child(it)
if i == 0:
but.grab_focus()
Expand Down
3 changes: 2 additions & 1 deletion device/ui/dialog_player.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://ui/dialog_default.tscn" type="PackedScene" id=1]
[ext_resource path="res://demo/ui/dialog_default.tscn" type="PackedScene" id=1]
[ext_resource path="res://globals/dialog_player.gd" type="Script" id=2]


[node name="dialog_player" type="ResourcePreloader"]

resources = [ PoolStringArray( "default" ), [ ExtResource( 1 ) ] ]
Expand Down
Loading

0 comments on commit 933e949

Please sign in to comment.