GUI demos converted to 3.0

This commit is contained in:
Juan Linietsky
2017-06-28 15:11:04 -03:00
parent 274c38799a
commit 4593bdcc64
74 changed files with 811 additions and 155 deletions

File diff suppressed because one or more lines are too long

View File

@@ -24,7 +24,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=2]
shader/shader = SubResource( 1 )
shader = SubResource( 1 )
shader_param/vignette = ExtResource( 6 )
_sections_unfolded = [ "shader", "shader_param" ]
@@ -41,7 +41,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=4]
shader/shader = SubResource( 3 )
shader = SubResource( 3 )
shader_param/amount = 4.0
_sections_unfolded = [ "shader", "shader_param" ]
@@ -62,7 +62,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=6]
shader/shader = SubResource( 5 )
shader = SubResource( 5 )
shader_param/size_x = null
shader_param/size_y = null
_sections_unfolded = [ "shader" ]
@@ -86,7 +86,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=8]
shader/shader = SubResource( 7 )
shader = SubResource( 7 )
shader_param/rotation = null
_sections_unfolded = [ "shader" ]
@@ -109,7 +109,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=10]
shader/shader = SubResource( 9 )
shader = SubResource( 9 )
shader_param/base = Color( 0.54451, 0.408353, 0.403137, 1 )
_sections_unfolded = [ "shader", "shader_param" ]
@@ -127,7 +127,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=12]
shader/shader = SubResource( 11 )
shader = SubResource( 11 )
_sections_unfolded = [ "shader" ]
[sub_resource type="Shader" id=13]
@@ -144,7 +144,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=14]
shader/shader = SubResource( 13 )
shader = SubResource( 13 )
_sections_unfolded = [ "shader" ]
[sub_resource type="Shader" id=15]
@@ -159,7 +159,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=16]
shader/shader = SubResource( 15 )
shader = SubResource( 15 )
_sections_unfolded = [ "shader" ]
[sub_resource type="Shader" id=17]
@@ -184,7 +184,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=18]
shader/shader = SubResource( 17 )
shader = SubResource( 17 )
shader_param/brightness = null
shader_param/contrast = null
shader_param/saturation = null
@@ -211,7 +211,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=20]
shader/shader = SubResource( 19 )
shader = SubResource( 19 )
shader_param/frequency = null
shader_param/depth = null
_sections_unfolded = [ "shader" ]
@@ -257,7 +257,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=22]
shader/shader = SubResource( 21 )
shader = SubResource( 21 )
shader_param/base = Color( 0.450274, 0.361255, 0.335059, 1 )
shader_param/grain_strength = 0.3
shader_param/fps = 12

View File

@@ -259,10 +259,10 @@ void fragment() {
shader/shader = SubResource( 21 )
shader_param/base = Color( 0.450274, 0.361255, 0.335059, 1 )
shader_param/grain_strength = null
shader_param/fps = null
shader_param/stretch = null
shader_param/flashing = null
shader_param/grain_strength = 0.3
shader_param/fps = 12
shader_param/stretch = 0.5
shader_param/flashing = 0.01
shader_param/grain = ExtResource( 8 )
shader_param/vignette = ExtResource( 6 )
_sections_unfolded = [ "shader", "shader_param" ]
@@ -510,6 +510,7 @@ _sections_unfolded = [ "Material" ]
[node name="old_film" type="TextureRect" parent="effects"]
visible = false
material = SubResource( 22 )
anchor_right = 1
anchor_bottom = 1

Binary file not shown.

View File

@@ -0,0 +1,20 @@
extends ColorPickerButton
func get_drag_data(pos):
# Use another colorpicker as drag preview
var cpb = ColorPickerButton.new()
cpb.color = color
cpb.rect_size = Vector2(50, 50)
set_drag_preview(cpb)
# Return color as drag data
return color
func can_drop_data(pos, data):
return typeof(data) == TYPE_COLOR
func drop_data(pos, data):
color=data

BIN
gui/drag_and_drop/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
[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

View File

@@ -0,0 +1,6 @@
[application]
icon = "res://icon.png"
main_scene = "res://drag_and_drop.scn"
name = "Drag & Drop (GUI)"

View File

@@ -0,0 +1,56 @@
extends Control
# Note for the reader:
#
# This demo conveniently uses the same names for actions and for the container nodes
# that hold each remapping button. This allow to get back to the button based simply
# on the name of the corresponding action, but it might not be so simple in your project.
#
# A better approach for large-scale input remapping might be to do the connections between
# buttons and wait_for_input through the code, passing as arguments both the name of the
# action and the node, e.g.:
# button.connect("pressed", self, "wait_for_input", [ button, action ])
# Member variables
var player_actions = [ "move_up", "move_down", "move_left", "move_right", "jump" ]
var action # To register the action the UI is currently handling
var button # Button node corresponding to the above action
func wait_for_input(action_bind):
action = action_bind
# See note at the beginning of the script
button = get_node("bindings").get_node(action).get_node("Button")
get_node("contextual_help").text="Press a key to assign to the '" + action + "' action."
set_process_input(true)
func _input(event):
# Handle the first pressed key
if (event is InputEventKey):
# Register the event as handled and stop polling
get_tree().set_input_as_handled()
set_process_input(false)
# Reinitialise the contextual help label
get_node("contextual_help").text="Click a key binding to reassign it, or press the Cancel action."
if (not event.is_action("ui_cancel")):
# Display the string corresponding to the pressed key
button.text=OS.get_scancode_string(event.scancode)
# Start by removing previously key binding(s)
for old_event in InputMap.get_action_list(action):
InputMap.action_erase_event(action, old_event)
# Add the new key binding
InputMap.action_add_event(action, event)
func _ready():
# Initialise each button with the default key binding from InputMap
var input_event
for action in player_actions:
# We assume that the key binding that we want is the first one (0), if there are several
input_event = InputMap.get_action_list(action)[0]
# See note at the beginning of the script
var button = get_node("bindings").get_node(action).get_node("Button")
button.text=OS.get_scancode_string(input_event.scancode)
button.connect("pressed", self, "wait_for_input", [action])

Binary file not shown.

BIN
gui/input_mapping/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
[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

View File

@@ -0,0 +1,19 @@
[application]
icon = "res://icon.png"
main_scene = "res://controls.scn"
name = "Input Mapping GUI"
[display]
window/height = 480
window/width = 640
[input]
jump = [ InputEvent(KEY,32) ]
move_down = [ InputEvent(KEY,16777234) ]
move_left = [ InputEvent(KEY,16777231) ]
move_right = [ InputEvent(KEY,16777233) ]
move_up = [ InputEvent(KEY,16777232) ]

View File

@@ -0,0 +1,155 @@
Copyright (c) 2008-2010, Accademia di Belle Arti di Urbino (www.campivisivi.net|direzione@accademiadiurbino.it),
with Reserved Font Name Titillium.
N: Luca Antonucci
W: http://www.campivisivi.net
D: Contributor
N: Paola Bacchiocchi
W: http://www.campivisivi.net
D: Contributor
N: Simone Bastianelli
W: http://www.campivisivi.net
D: Contributor
N: Valerio Bosi
W: http://www.campivisivi.net
D: Contributor
N: Fabio Cecchi
W: http://www.campivisivi.net
D: Contributor
N: Giulia Di Grusa
W: http://www.campivisivi.net
D: Contributor
N: Donatella Esposito
W: http://www.campivisivi.net
D: Contributor
N: Giulia Giordani
W: http://www.campivisivi.net
D: Contributor
N: Raffaele Mariotti
W: http://www.campivisivi.net
D: Contributor
N: Leslie Ameto
W: http://www.campivisivi.net
D: Contributor
N: Elisa Mearelli
W: http://www.campivisivi.net
D: Contributor
N: Silvia Mengarelli
W: http://www.campivisivi.net
D: Contributor
N: Roberto Mezzano
W: http://www.campivisivi.net
D: Contributor
N: Valentina Mingucci
W: http://www.campivisivi.net
D: Contributor
N: Andrea Monachesi
W: http://www.campivisivi.net
D: Contributor
N: Manuel Pasini
W: http://www.campivisivi.net
D: Contributor
N: David Pulga
W: http://www.campivisivi.net
D: Contributor
N: Luca Silvestri
W: http://www.campivisivi.net
D: Contributor
N: Paolo Tripodi
W: http://www.campivisivi.net
D: Contributor
N: Fancesco Zamboni
W: http://www.campivisivi.net
D: Contributor
N: Giuliano Chimenti
W: http://www.isiaurbino.it
D: Contributor
N: Francesco Piarulli
W: http://www.isiaurbino.it
D: Contributor
N: Ivan Abbattista
W: http://www.isiaurbino.it
D: Contributor
N: Rita Colacicco
W: http://www.isiaurbino.it
D: Contributor
N: Paolo Mazzetti
W: http://www.scriptype.net
D: Contributor
N: Claudio Piccinini
W: http://www.tht.it/
D: Contributor
N: Luciano Perondi
E: luciano.perondi@campivisivi.net
W: http://www.campivisivi.net
D: Director of progect
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
[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

View File

@@ -0,0 +1,10 @@
config_version=3
[application]
name="Rich Text Label (BBCode)"
main_scene="res://rich_text_bbcode.tscn"
icon="res://icon.png"
[memory]
multithread/thread_rid_pool_prealloc=60

View File

@@ -0,0 +1,6 @@
extends Panel
func _on_RichTextLabel_meta_clicked(meta):
OS.shell_open(meta)

View File

@@ -0,0 +1,85 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://rich_text_bbcode.gd" type="Script" id=1]
[ext_resource path="res://Titillium-BoldItalic.otf" type="DynamicFontData" id=2]
[ext_resource path="res://Titillium-RegularItalic.otf" type="DynamicFontData" id=3]
[ext_resource path="res://Titillium-Bold.otf" type="DynamicFontData" id=4]
[ext_resource path="res://Titillium-Regular.otf" type="DynamicFontData" id=5]
[sub_resource type="DynamicFont" id=1]
size = 20
use_mipmaps = false
use_filter = false
font_data = ExtResource( 2 )
_sections_unfolded = [ "Font", "Settings" ]
[sub_resource type="DynamicFont" id=2]
size = 20
use_mipmaps = false
use_filter = false
font_data = ExtResource( 3 )
_sections_unfolded = [ "Font", "Settings" ]
[sub_resource type="DynamicFont" id=3]
size = 20
use_mipmaps = false
use_filter = false
font_data = ExtResource( 4 )
_sections_unfolded = [ "Font", "Settings" ]
[sub_resource type="DynamicFont" id=4]
size = 20
use_mipmaps = false
use_filter = false
font_data = ExtResource( 5 )
_sections_unfolded = [ "Font", "Settings" ]
[node name="Panel" type="Panel"]
anchor_right = 1
anchor_bottom = 1
rect_clip_content = false
mouse_filter = 0
size_flags_horizontal = 2
size_flags_vertical = 2
script = ExtResource( 1 )
__meta__ = {
"__editor_plugin_screen__": "2D"
}
[node name="RichTextLabel" type="RichTextLabel" parent="."]
anchor_right = 1
anchor_bottom = 1
margin_left = 49.0
margin_top = 55.0
margin_right = 55.0
margin_bottom = 44.0
mouse_filter = 0
size_flags_horizontal = 2
size_flags_vertical = 2
custom_fonts/bold_italics_font = SubResource( 1 )
custom_fonts/italics_font = SubResource( 2 )
custom_fonts/bold_font = SubResource( 3 )
custom_fonts/normal_font = SubResource( 4 )
bbcode_enabled = true
bbcode_text = "[b][u]Rich Text Test[/u][/b]
RichTextLabel is a flexible way of adding text to your game, with support for [i]italics[/i], [b]bold[/b] and [i][b]both[/b][/i]. [u]Underline[/u] works too.
It is also possible to include [img]res://unicorn_icon.png[/img] custom images, as well as [color=aqua][url=http://www.google.com]Custom URLs[/url][/color].
Left alignment is default,[center]but center alignment is supported,[/center][right]as well as right alignment.[/right]
[fill]Fill alignment is also supported, and allows writing very long text that will end up fitting the horizontal space entirely with words of joy.[/fill]
For full reference [color=aqua][url=https://github.com/godotengine/godot/wiki/richtext_bbcode]check the wiki.[/url][/color]
"
visible_characters = -1
_sections_unfolded = [ "BBCode", "custom_fonts" ]
[connection signal="meta_clicked" from="RichTextLabel" to="." method="_on_RichTextLabel_meta_clicked"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/unicorn_icon.png-7e6ed0493ce9bae1105057e782fcd0de.stex"
[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

View File

@@ -0,0 +1,13 @@
Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,9 @@
extends Panel
func _on_back_pressed():
var s = load("res://main.scn")
var si = s.instance()
get_parent().add_child(si)
queue_free()

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/flag_japan.png-e7284e6af3de26ab9c66cac9c4062038.stex"
[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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/flag_spain.png-fd2012b4e19487cfc4923df0c268553f.stex"
[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

BIN
gui/translation/flag_uk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/flag_uk.png-eb8a2b26ac36f4d0cf0d7345e577ec2c.stex"
[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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,22 @@
[gd_resource type="DynamicFont" load_steps=7 format=2]
[ext_resource path="res://font/DroidSansArabic.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://font/DroidSansFallback.ttf" type="DynamicFontData" id=2]
[ext_resource path="res://font/DroidSansHebrew.ttf" type="DynamicFontData" id=3]
[ext_resource path="res://font/DroidSansJapanese.ttf" type="DynamicFontData" id=4]
[ext_resource path="res://font/DroidSansThai.ttf" type="DynamicFontData" id=5]
[ext_resource path="res://font/DroidSans.ttf" type="DynamicFontData" id=6]
[resource]
size = 16
use_mipmaps = false
use_filter = false
font_data = ExtResource( 6 )
fallback/0 = ExtResource( 1 )
fallback/1 = ExtResource( 2 )
fallback/2 = ExtResource( 3 )
fallback/3 = ExtResource( 4 )
fallback/4 = ExtResource( 5 )
_sections_unfolded = [ "Font", "Font/fallback" ]

Binary file not shown.

View File

@@ -0,0 +1,16 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/hello_en.wav-27ed59f2d75c1ba813ab0abd069b6758.sample"
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

Binary file not shown.

View File

@@ -0,0 +1,16 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/hello_es.wav-64fe245556f8642a1881ae257bd123f2.sample"
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

Binary file not shown.

View File

@@ -0,0 +1,16 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/hello_jp.wav-c31fbd7870b4b969789cb01f208809ac.sample"
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

BIN
gui/translation/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
[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

19
gui/translation/main.gd Normal file
View File

@@ -0,0 +1,19 @@
extends Panel
func _on_english_pressed():
TranslationServer.set_locale("en")
func _on_spanish_pressed():
TranslationServer.set_locale("es")
func _on_japanese_pressed():
TranslationServer.set_locale("ja")
func _on_play_pressed():
get_node("audio").play()

BIN
gui/translation/main.scn Normal file

Binary file not shown.

BIN
gui/translation/noto.fnt Normal file

Binary file not shown.

View File

@@ -0,0 +1,20 @@
config_version=3
config_version=null
[application]
name="Translation Demo"
main_scene="res://main.scn"
icon="res://icon.png"
[locale]
translation_remaps={
"res://flag_uk.png": [ "res://flag_spain.png:es", "res://flag_japan.png:ja" ],
"res://hello_en.wav": PoolStringArray( "res://hello_es.wav:es", "res://hello_jp.wav:ja" )
}
translations=PoolStringArray( "res://text.en.translation", "res://text.es.translation", "res://text.ja.translation" )
[memory]
multithread/thread_rid_pool_prealloc=60

BIN
gui/translation/speaker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

View File

@@ -0,0 +1,23 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/speaker.png-045bf6684b83b55b088824f14e175d16.stex"
[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

3
gui/translation/text.csv Normal file
View File

@@ -0,0 +1,3 @@
,en,es,ja
KEY_HELLO,Hello!,Hola!,こんにちは
KEY_PUSH,Push Me!,Aprétame!,押す
1 en es ja
2 KEY_HELLO Hello! Hola! こんにちは
3 KEY_PUSH Push Me! Aprétame! 押す

View File

@@ -0,0 +1,11 @@
[remap]
importer="csv_translation"
type="Translation"
[gen]
files=[ "res://text.en.translation", "res://text.es.translation", "res://text.ja.translation" ]
[params]
compress=true

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.