فهرست منبع

Added gui property examples

Björn Ritzl 1 سال پیش
والد
کامیت
8808faf349

+ 3 - 6
assets/ui.atlas

@@ -1,19 +1,16 @@
 images {
   image: "/assets/images/grid.png"
-  sprite_trim_mode: SPRITE_TRIM_MODE_OFF
 }
 images {
   image: "/assets/images/close.png"
-  sprite_trim_mode: SPRITE_TRIM_MODE_OFF
 }
 images {
   image: "/assets/images/header.png"
-  sprite_trim_mode: SPRITE_TRIM_MODE_OFF
 }
 images {
   image: "/assets/images/logo.png"
-  sprite_trim_mode: SPRITE_TRIM_MODE_OFF
 }
-margin: 0
+images {
+  image: "/assets/images/logo-color.png"
+}
 extrude_borders: 2
-inner_padding: 0

+ 19 - 787
examples/_main/loader.go

@@ -1,50 +1,16 @@
 components {
   id: "gui"
   component: "/examples/_main/ui.gui"
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 components {
   id: "script"
   component: "/examples/_main/loader.script"
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "movement/simple_move"
   type: "collectionproxy"
   data: "collection: \"/examples/movement/simple_move/simple_move.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "animation/spinner"
@@ -52,17 +18,6 @@ embedded_components {
   data: "collection: \"/examples/animation/spinner/spinner.collection\"\n"
   "exclude: true\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "basics/message_passing"
@@ -70,35 +25,12 @@ embedded_components {
   data: "collection: \"/examples/basics/message_passing/message_passing.collection\"\n"
   "exclude: true\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "movement/follow"
   type: "collectionproxy"
   data: "collection: \"/examples/movement/follow/follow.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "basics/parent_child"
@@ -106,359 +38,120 @@ embedded_components {
   data: "collection: \"/examples/basics/parent_child/parent_child.collection\"\n"
   "exclude: true\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "animation/flipbook"
   type: "collectionproxy"
   data: "collection: \"/examples/animation/flipbook/flipbook.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "physics/dynamic"
   type: "collectionproxy"
   data: "collection: \"/examples/physics/dynamic/dynamic.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "physics/kinematic"
   type: "collectionproxy"
   data: "collection: \"/examples/physics/kinematic/kinematic.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "physics/trigger"
   type: "collectionproxy"
   data: "collection: \"/examples/physics/trigger/trigger.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "animation/basic_tween"
   type: "collectionproxy"
   data: "collection: \"/examples/animation/basic_tween/basic_tween.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "factory/basic"
   type: "collectionproxy"
   data: "collection: \"/examples/factory/basic/basicfactory.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/button"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/button/button.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/stencil"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/stencil/stencil.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "input/move"
   type: "collectionproxy"
   data: "collection: \"/examples/input/move/move.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "input/text"
   type: "collectionproxy"
   data: "collection: \"/examples/input/text/text.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "debug/physics"
   type: "collectionproxy"
   data: "collection: \"/examples/debug/physics/physics.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "debug/profile"
   type: "collectionproxy"
   data: "collection: \"/examples/debug/profile/profile.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "input/down_duration"
   type: "collectionproxy"
   data: "collection: \"/examples/input/down_duration/down_duration.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/load_texture"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/load_texture/load_texture.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "particles/particlefx"
   type: "collectionproxy"
   data: "collection: \"/examples/particles/particlefx/particlefx.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/pointer_over"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/pointer_over/pointer_over.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "particles/modifiers"
   type: "collectionproxy"
   data: "collection: \"/examples/particles/modifiers/modifiers.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "particles/fire_and_smoke"
   type: "collectionproxy"
   data: "collection: \"/examples/particles/fire_and_smoke/fire_and_smoke.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "sound/music"
   type: "collectionproxy"
   data: "collection: \"/examples/sound/music/music.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "basics/z_order"
@@ -466,717 +159,256 @@ embedded_components {
   data: "collection: \"/examples/basics/z_order/z_order.collection\"\n"
   "exclude: true\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "sound/fade_in_out"
   type: "collectionproxy"
   data: "collection: \"/examples/sound/fade_in_out/fade_in_out.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "physics/raycast"
   type: "collectionproxy"
   data: "collection: \"/examples/physics/raycast/raycast.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "render/camera"
   type: "collectionproxy"
   data: "collection: \"/examples/render/camera/camera.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "collection/proxy"
   type: "collectionproxy"
   data: "collection: \"/examples/collection/proxy/proxy.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "sprite/size"
   type: "collectionproxy"
   data: "collection: \"/examples/sprite/size/size.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "file/sys_save_load"
   type: "collectionproxy"
   data: "collection: \"/examples/file/sys_save_load/sys_save_load.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "tilemap/collisions"
   type: "collectionproxy"
   data: "collection: \"/examples/tilemap/collisions/collisions.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "sprite/tint"
   type: "collectionproxy"
   data: "collection: \"/examples/sprite/tint/tint.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/color"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/color/color.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "input/mouse_and_touch"
   type: "collectionproxy"
   data: "collection: \"/examples/input/mouse_and_touch/mouse_and_touch.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "animation/chained_tween"
   type: "collectionproxy"
   data: "collection: \"/examples/animation/chained_tween/chained_tween.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "movement/movement_speed"
   type: "collectionproxy"
   data: "collection: \"/examples/movement/movement_speed/movement_speed.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "collection/splash"
   type: "collectionproxy"
   data: "collection: \"/examples/collection/splash/splash.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "tilemap/get_set_tile"
   type: "collectionproxy"
   data: "collection: \"/examples/tilemap/get_set_tile/get_set_tile.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "physics/hinge_joint"
   type: "collectionproxy"
   data: "collection: \"/examples/physics/hinge_joint/hinge_joint.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "sound/panning"
   type: "collectionproxy"
   data: "collection: \"/examples/sound/panning/panning.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "animation/cursor"
   type: "collectionproxy"
   data: "collection: \"/examples/animation/cursor/cursor.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "physics/pendulum"
   type: "collectionproxy"
   data: "collection: \"/examples/physics/pendulum/pendulum.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/slice9"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/slice9/slice9.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "sprite/flip"
   type: "collectionproxy"
   data: "collection: \"/examples/sprite/flip/flip.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "movement/move_to"
   type: "collectionproxy"
   data: "collection: \"/examples/movement/move_to/move_to.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "movement/move_forward"
   type: "collectionproxy"
   data: "collection: \"/examples/movement/move_forward/move_forward.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "movement/look_at"
   type: "collectionproxy"
   data: "collection: \"/examples/movement/look_at/look_at.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/progress"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/progress/progress.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "factory/bullets"
   type: "collectionproxy"
   data: "collection: \"/examples/factory/bullets/bullets.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "physics/knockback"
   type: "collectionproxy"
   data: "collection: \"/examples/physics/knockback/knockback.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "timer/repeating_timer"
   type: "collectionproxy"
   data: "collection: \"/examples/timer/repeating_timer/repeating_timer.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "timer/cancel_timer"
   type: "collectionproxy"
   data: "collection: \"/examples/timer/cancel_timer/cancel_timer.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "timer/trigger_timer"
   type: "collectionproxy"
   data: "collection: \"/examples/timer/trigger_timer/trigger_timer.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "animation/easing"
   type: "collectionproxy"
   data: "collection: \"/examples/animation/easing/easing.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "sprite/bunnymark"
   type: "collectionproxy"
   data: "collection: \"/examples/sprite/bunnymark/bunnymark.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "resource/modify_atlas"
   type: "collectionproxy"
   data: "collection: \"/examples/resource/modify_atlas/modify_atlas.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "factory/dynamic"
   type: "collectionproxy"
   data: "collection: \"/examples/factory/dynamic/dynamic.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "animation/spine"
   type: "collectionproxy"
   data: "collection: \"/examples/animation/spine/spine.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "render/screen_to_world"
   type: "collectionproxy"
   data: "collection: \"/examples/render/screen_to_world/screen_to_world.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "collection/timestep"
   type: "collectionproxy"
   data: "collection: \"/examples/collection/timestep/timestep.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "material/vertexcolor"
   type: "collectionproxy"
   data: "collection: \"/examples/material/vertexcolor/vertexcolor.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/drag"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/drag/drag.collection\"\n"
-  "exclude: false\n"
   ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
 }
 embedded_components {
   id: "gui/layouts"
   type: "collectionproxy"
   data: "collection: \"/examples/gui/layouts/layouts.collection\"\n"
-  "exclude: false\n"
-  ""
-  position {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
+  ""
+}
+embedded_components {
+  id: "gui/get_set_font"
+  type: "collectionproxy"
+  data: "collection: \"/examples/gui/get_set_font/get_set_font.collection\"\n"
+  ""
+}
+embedded_components {
+  id: "gui/get_set_material"
+  type: "collectionproxy"
+  data: "collection: \"/examples/gui/get_set_material/get_set_material.collection\"\n"
+  ""
+}
+embedded_components {
+  id: "gui/get_set_texture"
+  type: "collectionproxy"
+  data: "collection: \"/examples/gui/get_set_texture/get_set_texture.collection\"\n"
+  ""
 }

+ 6 - 1
examples/_main/menu.gui_script

@@ -105,7 +105,12 @@ function init(self)
 	self.index["movement"] = { "simple_move", "follow", "move_to", "move_forward", "movement_speed", "look_at" }
 	self.index["physics"] = { "dynamic", "kinematic", "raycast", "trigger", "hinge_joint", "pendulum", "knockback"}
 	self.index["animation"] = { "spinner", "flipbook", "chained_tween", "basic_tween", "spine", "cursor", "easing" }
-	self.index["gui"] = { "button", "stencil", "load_texture", "progress", "pointer_over", "color", "slice9", "drag", "layouts" }
+	self.index["gui"] = {
+		"button", "stencil", "load_texture",
+		"progress", "pointer_over", "color",
+		"slice9", "drag", "layouts",
+		"get_set_font", "get_set_texture", "get_set_material",
+	}
 	self.index["input"] = { "move", "text", "down_duration", "mouse_and_touch" }
 	self.index["material"] = { "vertexcolor" }
 	self.index["particles"] = { "particlefx", "modifiers", "fire_and_smoke" }

+ 14 - 0
examples/gui/get_set_font/get_set_font.collection

@@ -0,0 +1,14 @@
+name: "get_set_font"
+scale_along_z: 0
+embedded_instances {
+  id: "go"
+  data: "components {\n"
+  "  id: \"gui\"\n"
+  "  component: \"/examples/gui/get_set_font/get_set_font.gui\"\n"
+  "}\n"
+  "components {\n"
+  "  id: \"script\"\n"
+  "  component: \"/examples/gui/get_set_font/get_set_font.script\"\n"
+  "}\n"
+  ""
+}

+ 27 - 0
examples/gui/get_set_font/get_set_font.gui

@@ -0,0 +1,27 @@
+script: ""
+fonts {
+  name: "default"
+  font: "/builtins/fonts/default.font"
+}
+nodes {
+  position {
+    x: 360.0
+    y: 360.0
+  }
+  size {
+    x: 200.0
+    y: 100.0
+  }
+  color {
+    x: 0.2
+    y: 0.302
+    z: 0.702
+  }
+  type: TYPE_TEXT
+  text: "CLICK TO CHANGE FONT"
+  font: "default"
+  id: "text"
+  inherit_alpha: true
+}
+material: "/builtins/materials/gui.material"
+adjust_reference: ADJUST_REFERENCE_PARENT

+ 26 - 0
examples/gui/get_set_font/get_set_font.script

@@ -0,0 +1,26 @@
+-- create a script resource property 'myfont' referencing a font file
+go.property("myfont", resource.font("/assets/text64.font"))
+
+function init(self)
+	msg.post(".", "acquire_input_focus")
+
+	-- get the font file on the gui component which is assigned to
+	-- the font with id 'default'
+	self.default_font = go.get("#gui", "fonts", { key = "default" })
+end
+
+function on_input(self, action_id, action)
+	if action.pressed then
+		-- get the font file currently assigned to the font with id 'default'
+		local current_font = go.get("#gui", "fonts", { key = "default" })
+
+		-- toggle between the default font and the font referenced by the
+		-- script resource property 'myfont'
+		if current_font == self.myfont then
+			go.set("#gui", "fonts", self.default_font, { key = "default" })
+		else
+			go.set("#gui", "fonts", self.myfont, { key = "default" })
+		end
+	end
+end
+

+ 14 - 0
examples/gui/get_set_material/get_set_material.collection

@@ -0,0 +1,14 @@
+name: "get_set_material"
+scale_along_z: 0
+embedded_instances {
+  id: "go"
+  data: "components {\n"
+  "  id: \"gui\"\n"
+  "  component: \"/examples/gui/get_set_material/get_set_material.gui\"\n"
+  "}\n"
+  "components {\n"
+  "  id: \"script\"\n"
+  "  component: \"/examples/gui/get_set_material/get_set_material.script\"\n"
+  "}\n"
+  ""
+}

+ 10 - 0
examples/gui/get_set_material/get_set_material.fp

@@ -0,0 +1,10 @@
+varying mediump vec2 var_texcoord0;
+varying lowp vec4 var_color;
+
+uniform lowp sampler2D texture_sampler;
+
+void main()
+{
+    lowp vec4 tex = texture2D(texture_sampler, var_texcoord0.xy);
+    gl_FragColor = tex * var_color * vec4(var_texcoord0.y, var_texcoord0.x, 0.0, 1.0);
+}

+ 50 - 0
examples/gui/get_set_material/get_set_material.gui

@@ -0,0 +1,50 @@
+script: ""
+fonts {
+  name: "text24"
+  font: "/assets/text24.font"
+}
+nodes {
+  position {
+    x: 360.0
+    y: 360.0
+  }
+  size {
+    x: 200.0
+    y: 100.0
+  }
+  color {
+    x: 0.702
+    y: 0.8
+  }
+  type: TYPE_BOX
+  id: "box"
+  inherit_alpha: true
+  size_mode: SIZE_MODE_AUTO
+  material: "default"
+}
+nodes {
+  position {
+    x: 360.0
+    y: 100.0
+  }
+  size {
+    x: 200.0
+    y: 100.0
+  }
+  color {
+    x: 0.2
+    y: 0.302
+    z: 0.702
+  }
+  type: TYPE_TEXT
+  text: "CLICK TO CHANGE TEXTURE"
+  font: "text24"
+  id: "text"
+  inherit_alpha: true
+}
+material: "/builtins/materials/gui.material"
+adjust_reference: ADJUST_REFERENCE_PARENT
+materials {
+  name: "default"
+  material: "/builtins/materials/gui.material"
+}

+ 8 - 0
examples/gui/get_set_material/get_set_material.material

@@ -0,0 +1,8 @@
+name: "gui"
+tags: "gui"
+vertex_program: "/builtins/materials/gui.vp"
+fragment_program: "/examples/gui/get_set_material/get_set_material.fp"
+vertex_constants {
+  name: "view_proj"
+  type: CONSTANT_TYPE_VIEWPROJ
+}

+ 26 - 0
examples/gui/get_set_material/get_set_material.script

@@ -0,0 +1,26 @@
+-- create a script resource property 'myfont' referencing a font file
+go.property("mymaterial", resource.material("/examples/gui/get_set_material/get_set_material.material"))
+
+function init(self)
+	msg.post(".", "acquire_input_focus")
+
+	-- get the material file on the gui component which is assigned to
+	-- the material with id 'default'
+	self.default_texture = go.get("#gui", "materials", { key = "default" })
+end
+
+function on_input(self, action_id, action)
+	if action.pressed then
+		-- get the material file currently assigned to the material with id 'default'
+		local current_texture = go.get("#gui", "materials", { key = "default" })
+
+		-- toggle between the default material and the material referenced by the
+		-- script resource property 'default'
+		if current_texture == self.mymaterial then
+			go.set("#gui", "materials", self.default_texture, { key = "default" })
+		else
+			go.set("#gui", "materials", self.mymaterial, { key = "default" })
+		end
+	end
+end
+

+ 11 - 0
examples/gui/get_set_texture/get_set_texture.atlas

@@ -0,0 +1,11 @@
+images {
+  image: "/builtins/assets/images/logo/logo_blue_256.png"
+}
+animations {
+  id: "logo-color"
+  images {
+    image: "/builtins/assets/images/logo/logo_blue_256.png"
+  }
+  playback: PLAYBACK_NONE
+}
+extrude_borders: 2

+ 14 - 0
examples/gui/get_set_texture/get_set_texture.collection

@@ -0,0 +1,14 @@
+name: "get_set_texture"
+scale_along_z: 0
+embedded_instances {
+  id: "go"
+  data: "components {\n"
+  "  id: \"script\"\n"
+  "  component: \"/examples/gui/get_set_texture/get_set_texture.script\"\n"
+  "}\n"
+  "components {\n"
+  "  id: \"gui\"\n"
+  "  component: \"/examples/gui/get_set_texture/get_set_texture.gui\"\n"
+  "}\n"
+  ""
+}

+ 42 - 0
examples/gui/get_set_texture/get_set_texture.gui

@@ -0,0 +1,42 @@
+script: ""
+fonts {
+  name: "text24"
+  font: "/assets/text24.font"
+}
+textures {
+  name: "ui"
+  texture: "/assets/ui.atlas"
+}
+nodes {
+  position {
+    x: 360.0
+    y: 360.0
+  }
+  type: TYPE_BOX
+  texture: "ui/logo-color"
+  id: "box"
+  inherit_alpha: true
+  size_mode: SIZE_MODE_AUTO
+}
+nodes {
+  position {
+    x: 360.0
+    y: 100.0
+  }
+  size {
+    x: 200.0
+    y: 100.0
+  }
+  color {
+    x: 0.2
+    y: 0.302
+    z: 0.702
+  }
+  type: TYPE_TEXT
+  text: "CLICK TO CHANGE TEXTURE"
+  font: "text24"
+  id: "text"
+  inherit_alpha: true
+}
+material: "/builtins/materials/gui.material"
+adjust_reference: ADJUST_REFERENCE_PARENT

+ 26 - 0
examples/gui/get_set_texture/get_set_texture.script

@@ -0,0 +1,26 @@
+-- create a script resource property 'myatlas' referencing an atlas file
+go.property("myatlas", resource.atlas("/examples/gui/get_set_texture/get_set_texture.atlas"))
+
+function init(self)
+	msg.post(".", "acquire_input_focus")
+
+	-- get the atlas file on the gui component which is assigned to
+	-- the atlas/texture with id 'ui'
+	self.default_atlas = go.get("#gui", "textures", { key = "ui" })
+end
+
+function on_input(self, action_id, action)
+	if action.pressed then
+		-- get the atlas file currently assigned to the atlas/texture with id 'ui'
+		local current_atlas = go.get("#gui", "textures", { key = "ui" })
+
+		-- toggle between the default texture and the texture referenced by the
+		-- script resource property 'ui'
+		if current_atlas == self.myatlas then
+			go.set("#gui", "textures", self.default_atlas, { key = "ui" })
+		else
+			go.set("#gui", "textures", self.myatlas, { key = "ui" })
+		end
+	end
+end
+