From 26e18cdfe83666c1665ffa3daa5da23ca1fe8505 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Wed, 18 Jun 2025 21:17:13 +0100 Subject: [PATCH] feedback from az scripts changed to reflect a better standard of loading offscreencanvas on client and not on the server --- .../game/data/Prototyping/Prototyping.tscript | 15 +++++++ .../monitor_base_mat.asset.taml | 1 + .../gui_offscreen_test/monitor_shape.tscript | 41 ------------------- 3 files changed, 16 insertions(+), 41 deletions(-) diff --git a/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript b/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript index c053fd2cf..bd3841f9e 100644 --- a/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript +++ b/Templates/BaseGame/game/data/Prototyping/Prototyping.tscript @@ -42,6 +42,21 @@ function Prototyping::initClient(%this) //This is called when a client connects to a server function Prototyping::onCreateClientConnection(%this) { + if (!isObject(screen_Canvas)) + { + new GuiOffscreenCanvas(screen_Canvas) { + targetName = "screen_Canvas"; + targetSize = "1280 720"; + dynamicTarget = false; + canInteract = true; + maxInteractDistance = "3"; + }; + } + + if(isObject(OptionsMenu)) + { + screen_Canvas.setContent(OptionsMenu); + } } //This is called when a client disconnects from a server diff --git a/Templates/BaseGame/game/data/Prototyping/gui_offscreen_test/monitor_base_mat.asset.taml b/Templates/BaseGame/game/data/Prototyping/gui_offscreen_test/monitor_base_mat.asset.taml index 75d507122..6267d5871 100644 --- a/Templates/BaseGame/game/data/Prototyping/gui_offscreen_test/monitor_base_mat.asset.taml +++ b/Templates/BaseGame/game/data/Prototyping/gui_offscreen_test/monitor_base_mat.asset.taml @@ -4,6 +4,7 @@