mikepixie's Forum Posts

  • Hi zatyka, I just had a look and it seems pretty seamless, I will see if I can adapt this technique to my needs!

  • Hi guys it's been a while but I am back in Construct land.

    I have been playing around with the canvas snapshot expression and its great, however it does not seem to be able to take a snapshot of a specific area of the canvas.

    Lets say I am building an image editor of a sort in Construct. I have some form controls that let the user load some different bits of clipart and arrange them in layers by dragging them around. I would like to be able to take a snapshot of just the area of the canvas where the user has created their masterpiece.

    Is this possible out the box?

    Mike

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yeah, I have found that this problem and many others seems to occur when you break the limits of your target hardware. Images too big, too many images, general memory consumption. Sprite sheets seem to have helped a lot...

    as a side note I hope to get involved in the forums again, its been a while but a two year old son will do that :D

  • Wow fantastic, that is just what I needed and the helpful hint is very helpful indeed.

  • Hi tap

    I was wondering if you could answer some questions about the api, I am building a custom plugin for something and I need to make an appmobi friendly version of it.

    Is AppMobi.device.launchExternal(url); a drop in replacement for window.open? If so can I send a message back to the app using an event listener (app side) and window.opener.postMessage("mymessage" , '*'); from the opened window.

    This works flawlessly when I use window.open from a chrome based game. However window.open seems to break my app in appmobi (compiled as an apk or in test anywhere.) and I get a white screen of doom.

    Mike

  • Awesome, consider me subscribed to you on github.

  • There is an empty Repo which I am looking forward to seeing filled up!

    github.com/sirg2003/TMX-TO-CONSTRUCT-2-converter

  • bhavanvaishnav Is it possible to re upload the latest working version you have made of this plugin? I have some things I would like to do with it but would rather start with your version as it seems to be one of the most up to date versions of the plugin.

  • Hey Tap

    Is it possible to release this on github rather than dropbox?

    It will make keeping up to date a lot easier.

  • If you are building for android you can remove it in the android manifest.

  • Just a follow up to this. I have managed to implement cross document messaging which seems to work on mobile using window.postMessage.

    My plugin has an action which calls the following function:

    function gameAuthorise(authUrl) {
         window.open(authUrl);
         window.addEventListener('message', function (event) {
         userToken = event.data;
         bRuntime.trigger(cr.plugins_.myplugin_mp.prototype.cnds.authComplete, bInst);
         });
    }
    

    On the server that proxies the oAuth the following code sends the token to my event listener. The token is returned as an expression of my plugin.

            <div id="mytoken"><? echo htmlentities($_GET['token']) ?></div>
             <script>
                var token = document.getElementById("mytoken")
                window.opener.postMessage(token.innerHTML , '*');
                window.close();
            </script>
    

    This code worked for me, obviously you will need to set up the trigger for your own plugin.

    I hope this helps anyone who is building custom plugins for accessing 3rd party web services that require oAuth.

  • Apparently I have been missing a trick, The correct way to do this is with parent.postMessage and an event listener.

    I shall report back on my findings.

  • Just the ticket! Thanks Rex.

  • I just want to say, this is an amazing project and it deservers a bump!

    M

  • Some extra info, I am trying post back from the child browser using:

    window.opener.cr.plugins_.MYPLUGIN.prototype.getToken(myVal);

    Is this vaguely right?