Extras Extras / Core Extras / Curves Extras / Objects App →
A class for setting up a 3D application, capable of loading the Puzzles
editor and executing visual logic code.
Performs app initialization/loading in the following order:
AppPuzzles(containerId, ctxSettings, preloader)
- the id of an HTML-element containing the canvas.
- the WebGL context attributes to be passed in the 'canvas.getContext()' method.
- the application's Preloader.
See the base
class for common properties.
An object containing functions created in the Puzzles Editor to
access them from the application's code. Typical usage: calling a
function manually, setting/overriding a function.
See the base
class for common methods.
Load a gltf scene specified by the url parameter.
Load a gltf scene along with the Puzzles Editor. The editor needs
to be provided with the path to the target logic JS file (specified
by the logicURL parameter) and with the path to the Puzzles
Editor's resource folder (specified by the editorDir parameter,
should have the content of the SDK's 'puzzles' folder).
Load a gltf scene along with the code generated from the Puzzles
Editor (specified by the logicURL parameter).
A callback, called when the Puzzles Editor was successfully loaded.
A callback, called when an error is occured during the loading process.
Some specific errors with the following names are also generated:
EditorLoadError - the Puzzles Editor wasn't properly loaded
LogicLoadError - the logic file wasn't properly loaded
SceneLoadError - the scene file wasn't properly loaded
Prints all errors in the browser console by default.
# . onLoadFinished (sceneLoaded, logicLoaded, editorLoaded) : null
A callback, called when all loading actions are finsihed successfully
or not, which is indicated by its parameters: sceneLoaded,
logicLoaded and editorLoaded.
By default calls the
method if a scene was loaded.
A callback, called when the logic file was successfully loaded.
A callback, called when the scene file was successfully loaded.
Starts the application by removing the preloader, starting the
rendering cycle and executing the logic script.