Javascript (Construct 3 Plugins)

  • 57
    This content is deleted
    Addon
    Javascript

    Use 3rd party JS libraries (including JQuery), call Javascript functions, access object properties and methods. Implement game objects, and algorithms in Javasc...

You're viewing a single comment in a conversation. View all the comments
  • 6 Comments

  • Order by
  • Is there any Callback-Function?

    Example. I have a timeout-function at javascript. After the timeout, i will call a condition in construct 3:

    setTimeout(timeisover,1000);

    function timeisover() {

    var x = 0;

    if(x==0) {

    // Call Construct3-Condition with Argument

    CallbackFunctionToConstruct3(x);

    }

    }

    I hope you understand what i mean.. :)

    • Well you sure can't call a condition.

      But you can fire a trigger of some Construct Plugin. You can also call a Construct Function (Function plugin type) from javascript. See c2_callFunction here scirra.com/tutorials/1078/bridging-js-and-c2 (c3_callFunction for C3 runtime). You can totally use it as a callback.

      Feel free to text me if you have any problems with that.

      • Ok, i have tested it (with function-plugin), but don't work for me. I don't know why!?

        Uncaught TypeError: Cannot read property 'GetEventSheet' of null

        at C3.EventSheetManager._FastTrigger (eventSheetManager.js:1)

        at C3.Runtime.FastTrigger (runtime.js:1)

        at C3.Plugins.Function.Instance.FastTrigger (sdkInstanceBase.js:1)

        at C3.Plugins.Function.Instance._InvokeFromJS (instance.js:1)

        at b (instance.js:1)

        at blob:https://preview.construct.net/45780e92-7585-4277-b9cd-4455a80a4f1b:26

        Have you a example-file for this?