diff options
Diffstat (limited to 'demos')
26 files changed, 121 insertions, 0 deletions
diff --git a/demos/2d/isometric/bastiles.res b/demos/2d/isometric/bastiles.res Binary files differindex 2161c88f1e..50f3c78321 100644 --- a/demos/2d/isometric/bastiles.res +++ b/demos/2d/isometric/bastiles.res diff --git a/demos/2d/isometric/dungeon.scn b/demos/2d/isometric/dungeon.scn Binary files differindex 58c530d5c5..64efc257c0 100644 --- a/demos/2d/isometric/dungeon.scn +++ b/demos/2d/isometric/dungeon.scn diff --git a/demos/2d/isometric/tileset.scn b/demos/2d/isometric/tileset.scn Binary files differindex edb0bc0276..c04ea5382c 100644 --- a/demos/2d/isometric/tileset.scn +++ b/demos/2d/isometric/tileset.scn diff --git a/demos/2d/isometric/troll.scn b/demos/2d/isometric/troll.scn Binary files differindex f5d87c3631..19b566fe05 100644 --- a/demos/2d/isometric/troll.scn +++ b/demos/2d/isometric/troll.scn diff --git a/demos/2d/isometric_light/cubio.scn b/demos/2d/isometric_light/cubio.scn Binary files differindex c52b7dfd4b..fc931b0c8d 100644 --- a/demos/2d/isometric_light/cubio.scn +++ b/demos/2d/isometric_light/cubio.scn diff --git a/demos/2d/isometric_light/map.scn b/demos/2d/isometric_light/map.scn Binary files differindex c1d11f8e4c..89002f991f 100644 --- a/demos/2d/isometric_light/map.scn +++ b/demos/2d/isometric_light/map.scn diff --git a/demos/2d/isometric_light/tileset.res b/demos/2d/isometric_light/tileset.res Binary files differindex dab6f36f57..f64a4e32bd 100644 --- a/demos/2d/isometric_light/tileset.res +++ b/demos/2d/isometric_light/tileset.res diff --git a/demos/2d/lookat/arrow.png b/demos/2d/lookat/arrow.png Binary files differnew file mode 100644 index 0000000000..25db91e8d1 --- /dev/null +++ b/demos/2d/lookat/arrow.png diff --git a/demos/2d/lookat/engine.cfg b/demos/2d/lookat/engine.cfg new file mode 100644 index 0000000000..56917a39ec --- /dev/null +++ b/demos/2d/lookat/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="Look At Pointer" +main_scene="res://lookat.scn" diff --git a/demos/2d/lookat/lookat.gd b/demos/2d/lookat/lookat.gd new file mode 100644 index 0000000000..742c5b0671 --- /dev/null +++ b/demos/2d/lookat/lookat.gd @@ -0,0 +1,43 @@ + +extends Sprite + +# member variables here, example: +# var a=2 +# var b="textvar" + +const MODE_DIRECT=0 +const MODE_CONSTANT=1 +const MODE_SMOOTH=2 + +const ROTATION_SPEED = 1 +const SMOOTH_SPEED = 2.0 + +export(int,"Direct","Constant","Smooth") var mode=MODE_DIRECT + +func _process(delta): + var mpos = get_viewport().get_mouse_pos() + + if (mode==MODE_DIRECT): + + look_at(mpos) + + elif (mode==MODE_CONSTANT): + + var ang = get_angle_to(mpos) + var s = sign(ang) + ang=abs(ang) + + rotate( min(ang,ROTATION_SPEED*delta)*s ) + + elif (mode==MODE_SMOOTH): + + var ang = get_angle_to(mpos) + + rotate( ang*delta*SMOOTH_SPEED ) + +func _ready(): + # Initialization here + set_process(true) + pass + + diff --git a/demos/2d/lookat/lookat.scn b/demos/2d/lookat/lookat.scn Binary files differnew file mode 100644 index 0000000000..880070b4c7 --- /dev/null +++ b/demos/2d/lookat/lookat.scn diff --git a/demos/3d/platformer/bullet.scn b/demos/3d/platformer/bullet.scn Binary files differindex 4f1623b7d9..da90dba1a5 100644 --- a/demos/3d/platformer/bullet.scn +++ b/demos/3d/platformer/bullet.scn diff --git a/demos/gui/translation/controls.gd b/demos/gui/translation/controls.gd new file mode 100644 index 0000000000..f8403f49a7 --- /dev/null +++ b/demos/gui/translation/controls.gd @@ -0,0 +1,20 @@ + +extends Panel + +# member variables here, example: +# var a=2 +# var b="textvar" + +func _ready(): + # Initialization here + pass + + + + +func _on_back_pressed(): + var s = load("res://main.scn") + var si = s.instance() + get_parent().add_child(si) + queue_free() + pass # replace with function body diff --git a/demos/gui/translation/controls.scn b/demos/gui/translation/controls.scn Binary files differnew file mode 100644 index 0000000000..66e6d47702 --- /dev/null +++ b/demos/gui/translation/controls.scn diff --git a/demos/gui/translation/engine.cfg b/demos/gui/translation/engine.cfg new file mode 100644 index 0000000000..169b65e154 --- /dev/null +++ b/demos/gui/translation/engine.cfg @@ -0,0 +1,9 @@ +[application] + +name="Translation Demo" +main_scene="res://main.scn" + +[locale] + +translations=["res://translations/text.en.xl", "res://translations/text.es.xl", "res://translations/text.ja.xl"] +translation_remaps={"res://flag_uk.png":["res://flag_spain.png:es", "res://flag_japan.png:ja"]} diff --git a/demos/gui/translation/flag_japan.png b/demos/gui/translation/flag_japan.png Binary files differnew file mode 100644 index 0000000000..4cc8267a5c --- /dev/null +++ b/demos/gui/translation/flag_japan.png diff --git a/demos/gui/translation/flag_spain.png b/demos/gui/translation/flag_spain.png Binary files differnew file mode 100644 index 0000000000..4d00f93593 --- /dev/null +++ b/demos/gui/translation/flag_spain.png diff --git a/demos/gui/translation/flag_uk.png b/demos/gui/translation/flag_uk.png Binary files differnew file mode 100644 index 0000000000..53fbef3d67 --- /dev/null +++ b/demos/gui/translation/flag_uk.png diff --git a/demos/gui/translation/main.gd b/demos/gui/translation/main.gd new file mode 100644 index 0000000000..bf3c0c0840 --- /dev/null +++ b/demos/gui/translation/main.gd @@ -0,0 +1,42 @@ + +extends Panel + +# member variables here, example: +# var a=2 +# var b="textvar" + +func _ready(): + # Initialization here + pass + + + +func _goto_scene(): + var s = load("res://controls.scn") + var si = s.instance() + get_parent().add_child(si) + queue_free() + pass + + +func _on_system_pressed(): + #will autodetect based on system, then fall back + #to english if not found + _goto_scene() + +#NOTE: Changling locale will not change the text in the controls, +# The scene must be reloaded for changes to take effect. + +func _on_english_pressed(): + TranslationServer.set_locale("en") + _goto_scene() + + +func _on_spanish_pressed(): + TranslationServer.set_locale("es") + _goto_scene() + + +func _on_japanese_pressed(): + TranslationServer.set_locale("ja") + _goto_scene() diff --git a/demos/gui/translation/main.scn b/demos/gui/translation/main.scn Binary files differnew file mode 100644 index 0000000000..76c9ba7b45 --- /dev/null +++ b/demos/gui/translation/main.scn diff --git a/demos/gui/translation/noto.fnt b/demos/gui/translation/noto.fnt Binary files differnew file mode 100644 index 0000000000..e019615f41 --- /dev/null +++ b/demos/gui/translation/noto.fnt diff --git a/demos/gui/translation/notosans.otf b/demos/gui/translation/notosans.otf Binary files differnew file mode 100644 index 0000000000..6443f9023e --- /dev/null +++ b/demos/gui/translation/notosans.otf diff --git a/demos/gui/translation/text.csv b/demos/gui/translation/text.csv new file mode 100644 index 0000000000..0f4c148b95 --- /dev/null +++ b/demos/gui/translation/text.csv @@ -0,0 +1,3 @@ +,en,es,ja +KEY_HELLO,Hello!,Hola!,こんにちは +KEY_PUSH,Push Me!,Aprétame!,私をプッシュ
\ No newline at end of file diff --git a/demos/gui/translation/translations/text.en.xl b/demos/gui/translation/translations/text.en.xl Binary files differnew file mode 100644 index 0000000000..7bcba63e71 --- /dev/null +++ b/demos/gui/translation/translations/text.en.xl diff --git a/demos/gui/translation/translations/text.es.xl b/demos/gui/translation/translations/text.es.xl Binary files differnew file mode 100644 index 0000000000..4474d955d5 --- /dev/null +++ b/demos/gui/translation/translations/text.es.xl diff --git a/demos/gui/translation/translations/text.ja.xl b/demos/gui/translation/translations/text.ja.xl Binary files differnew file mode 100644 index 0000000000..b3d1f0bf60 --- /dev/null +++ b/demos/gui/translation/translations/text.ja.xl |