diff --git a/example/example.gui_script b/example/example.gui_script index b3bafd3..c570684 100644 --- a/example/example.gui_script +++ b/example/example.gui_script @@ -22,6 +22,24 @@ local function save_cache(self) end +-- Change current browser URL to share the examples +---@param self userdata +---@param scene_name string +local function set_scene_url(self, scene_name) + if not html5 then + return + end + + local command + if scene_name then + command = string.format('window.history.replaceState(null, null, "?example=%s")', scene_name) + else + command = 'window.history.replaceState(null, null, "index.html")' + end + html5.run(command) +end + + local function back_to_lobby(self) if gui.set_enabled(self.button_menu.node) then return @@ -37,6 +55,7 @@ local function back_to_lobby(self) self.cache.last_scene = nil save_cache(self) + set_scene_url(self, nil) end @@ -54,6 +73,7 @@ local function show_scene(self, scene_name, text_header) self.cache.last_scene = scene_name save_cache(self) + set_scene_url(self, scene_name) end diff --git a/example/examples/layout/layout_fit/layout_fit.gui b/example/examples/layout/layout_fit/layout_fit.gui index fddab63..0bfca9b 100644 --- a/example/examples/layout/layout_fit/layout_fit.gui +++ b/example/examples/layout/layout_fit/layout_fit.gui @@ -67,6 +67,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_MANUAL custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -123,6 +125,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -144,8 +148,8 @@ nodes { w: 1.0 } size { - x: 140.0 - y: 172.0 + x: 200.0 + y: 100.0 z: 0.0 w: 1.0 } @@ -179,6 +183,74 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true +} +nodes { + position { + x: -185.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 300.0 + y: 100.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_TEXT + blend_mode: BLEND_MODE_ALPHA + text: "Original image:" + font: "game" + id: "text_hint_" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + outline { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + shadow { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + adjust_mode: ADJUST_MODE_FIT + line_break: false + parent: "image" + layer: "" + inherit_alpha: true + alpha: 1.0 + outline_alpha: 0.75 + shadow_alpha: 0.0 + template_node_child: false + text_leading: 1.0 + text_tracking: 0.0 + custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -235,6 +307,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_MANUAL custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -256,8 +330,8 @@ nodes { w: 1.0 } size { - x: 140.0 - y: 172.0 + x: 200.0 + y: 100.0 z: 0.0 w: 1.0 } @@ -291,6 +365,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -355,6 +431,8 @@ nodes { text_leading: 1.0 text_tracking: 0.0 custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -411,6 +489,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_MANUAL custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -432,8 +512,8 @@ nodes { w: 1.0 } size { - x: 140.0 - y: 172.0 + x: 200.0 + y: 100.0 z: 0.0 w: 1.0 } @@ -467,6 +547,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -531,6 +613,8 @@ nodes { text_leading: 1.0 text_tracking: 0.0 custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -587,6 +671,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_MANUAL custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -608,8 +694,8 @@ nodes { w: 1.0 } size { - x: 140.0 - y: 172.0 + x: 200.0 + y: 100.0 z: 0.0 w: 1.0 } @@ -643,6 +729,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -707,6 +795,8 @@ nodes { text_leading: 1.0 text_tracking: 0.0 custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -763,6 +853,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_MANUAL custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -784,8 +876,8 @@ nodes { w: 1.0 } size { - x: 140.0 - y: 172.0 + x: 200.0 + y: 100.0 z: 0.0 w: 1.0 } @@ -819,6 +911,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -883,6 +977,8 @@ nodes { text_leading: 1.0 text_tracking: 0.0 custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -939,6 +1035,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_MANUAL custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -960,8 +1058,8 @@ nodes { w: 1.0 } size { - x: 140.0 - y: 172.0 + x: 200.0 + y: 100.0 z: 0.0 w: 1.0 } @@ -995,6 +1093,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -1059,6 +1159,8 @@ nodes { text_leading: 1.0 text_tracking: 0.0 custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -1115,6 +1217,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_MANUAL custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -1136,8 +1240,8 @@ nodes { w: 1.0 } size { - x: 140.0 - y: 172.0 + x: 200.0 + y: 100.0 z: 0.0 w: 1.0 } @@ -1171,6 +1275,8 @@ nodes { template_node_child: false size_mode: SIZE_MODE_AUTO custom_type: 0 + enabled: true + visible: true } nodes { position { @@ -1235,6 +1341,8 @@ nodes { text_leading: 1.0 text_tracking: 0.0 custom_type: 0 + enabled: true + visible: true } layers { name: "image" diff --git a/example/game.appmanifest b/example/game.appmanifest index c16be5a..251e444 100644 --- a/example/game.appmanifest +++ b/example/game.appmanifest @@ -1,83 +1,71 @@ -# App manifest generated Sat Mar 21 2020 23:36:54 GMT+0300 (Moscow Standard Time) -# Settings: Physics2D,Physics3D,Record,Profiler platforms: - x86_64-osx: - context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx"] - libs: ["physics_null","record_null"] - linkFlags: [] - - x86_64-linux: - context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] - linkFlags: [] - - js-web: - context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeJsLibs: [] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] - linkFlags: [] - - wasm-web: - context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeJsLibs: [] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] - linkFlags: [] - - x86-win32: - context: - excludeLibs: ["libphysics","libLinearMath","libBulletDynamics","libBulletCollision","libBox2D","librecord","vpx","libprofilerext"] - excludeSymbols: ["ProfilerExt"] - libs: ["libphysics_null.lib","librecord_null.lib","libprofilerext_null.lib"] - linkFlags: [] - - x86_64-win32: - context: - excludeLibs: ["libphysics","libLinearMath","libBulletDynamics","libBulletCollision","libBox2D","librecord","vpx","libprofilerext"] - excludeSymbols: ["ProfilerExt"] - libs: ["libphysics_null.lib","librecord_null.lib","libprofilerext_null.lib"] - linkFlags: [] - - armv7-android: - context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeJars: [] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] - linkFlags: [] - - arm64-android: - context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeJars: [] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] - linkFlags: [] - armv7-ios: context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] linkFlags: [] - arm64-ios: context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] linkFlags: [] - x86_64-ios: context: - excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] - excludeSymbols: ["ProfilerExt"] - libs: ["physics_null","record_null","profilerext_null"] + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] + linkFlags: [] + armv7-android: + context: + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeJars: [] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] + linkFlags: [] + arm64-android: + context: + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeJars: [] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] + linkFlags: [] + x86_64-osx: + context: + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] + linkFlags: [] + x86_64-linux: + context: + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] + linkFlags: [] + x86-win32: + context: + excludeLibs: [libphysics, libLinearMath, libBulletDynamics, libBulletCollision, libBox2D, librecord, vpx, libprofilerext, libliveupdate] + excludeSymbols: [ProfilerExt] + libs: [libphysics_null.lib, librecord_null.lib, libprofilerext_null.lib, libliveupdate_null.lib] + linkFlags: [] + x86_64-win32: + context: + excludeLibs: [libphysics, libLinearMath, libBulletDynamics, libBulletCollision, libBox2D, librecord, vpx, libprofilerext, libliveupdate] + excludeSymbols: [ProfilerExt] + libs: [libphysics_null.lib, librecord_null.lib, libprofilerext_null.lib, libliveupdate_null.lib] + linkFlags: [] + js-web: + context: + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeJsLibs: [] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] + linkFlags: [] + wasm-web: + context: + excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate] + excludeJsLibs: [] + excludeSymbols: [ProfilerExt] + libs: [physics_null, record_null, profilerext_null, liveupdate_null] linkFlags: [] -