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
  • 4 Comments

  • Order by
  • I tried it out recently and overall it looks pretty useful. Awesome.

    One thing I noticed is that return values do not work if the returning is delayed, in my case I had to load an image onto a canvas, process some stuff and then return it. In order to properly load the image I had to wait for image.onload, the plugin didn´t wait and always returned 0. I worked around it by loading the image in a previous function, but it would be great if there was a trigger event like "on function 'functionCall' value returned" to allow this sort of things.

    • Can you show me the code of the function that you're talking about? The one that returns 0?

      • Hmm I already changed it, but I actually think I know the issue. What I did was

        function loadImage(img){

        var image = new image();

        image.onload = function() {

        return "whatever";

        }

        image.src = img;

        }

        and if I´m not mistaken the "return" on that place will not return the value where I need it to be returned. My b!