Added new condition to check the zoom of a camera of a layer (#6747)

This commit is contained in:
Tristan Rhodes
2024-07-04 06:05:35 -06:00
committed by GitHub
parent f62811974d
commit 8c88038bfb
2 changed files with 21 additions and 0 deletions

View File

@@ -327,6 +327,25 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
extension
.AddCondition(
"CameraZoom",
_("Camera zoom"),
_("Compare the zoom of a camera of a layer."),
_("Zoom of camera _PARAM2_ of layer _PARAM1_"),
"",
"res/conditions/camera24.png",
"res/conditions/camera.png")
.AddCodeOnlyParameter("currentScene", "")
.AddParameter("layer", _("Layer"), "", true)
.SetDefaultValue("\"\"")
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0")
.UseStandardRelationalOperatorParameters(
"number", gd::ParameterOptions::MakeNewOptions().SetDescription(
_("Zoom")))
.MarkAsAdvanced();
extension
.AddAction(
"FixCamera",

View File

@@ -69,6 +69,8 @@ CameraExtension::CameraExtension() {
.SetGetter("gdjs.evtTools.camera.getCameraRotation");
GetAllActions()["ZoomCamera"].SetFunctionName(
"gdjs.evtTools.camera.setCameraZoom");
GetAllConditions()["CameraZoom"].SetFunctionName(
"gdjs.evtTools.camera.getCameraZoom");
GetAllExpressions()["CameraX"].SetFunctionName(
"gdjs.evtTools.camera.getCameraX"); // Deprecated