R0J0hound's Forum Posts

  • Yes it is possible. The plugin does nothing to help, but you can do it by other means.

  • it's hard if the browser doesn't support that. Actually I can't think of any other way of saving a screenshot other than doing the screenshot button shortcut on android.

  • If you add the js file you want to use to your project's "files" folder then you can load it with:

    "$.getScript('band.js');"

    Or if you have the URL of the library you could use that too.

    Now, it won't be immediately usable. That's a request to download and run it. You can either wait a while and guess when it's loaded to use it, or if you add the fuction object to your project you can have it trigger a event sheet function when it's done loaded and ready to use.

    Say you call the function "loaded" then the js you run would be:

    "$.getScript('band.js', function(){c2_callFunction('loaded', []);});"

    Now, that works if the JavaScript library is one file, but some depend on other files to be loaded first so you'd need to add more events for that in the same way. You can search for posts by me about the browser object to get some examples. Also note this is made much simpler if you made a plugin, since you can just add a list of dependencies to editime.js and they just get loaded in order with no fuss.

    Next thing to note is you'll be getting used to looking at the browser's dev console a lot since any typos will lead to errors. If you did it in a plugin the web browser can be more helpful in pointing out what is amiss. Code run from the browser object gives more vague errors.

    Finally if you define any JavaScript vars inside an execJs action it won't exist next time you run it.

    For example if you run this

    "var myVariable=1337;"

    Then run this, you'll get an error because the var no longer exists.

    "myVariable+1"

    You can make a global var by using "window" like so:

    "window.myVariable=1337;"

    Then myVariable is global and you can use it like the following without issue:

    "myVariable+=1;"

    The logic behind this is "window" is the global namespace in the browser. I think it still is in nwjs but I'm not certain since I've seen libraries set themselves up differently under nwjs.

  • sletts

    There may be some tutorials that I'm unaware of but it's pretty easy to use. Just look at the actions and most are self explanatory. It uses the HTML5 canvas so you could google tutorials for that and it's mostly a one to one with this plugin.

    There's an action to do a flood fill and erasing is done by pasting an object with the destination out blend mode.

    Replaying should just be a matter of making a list of the actions you used as you use them. Then just make some events to loop over the list and does what was saved. You probably could use an array to do the list.

  • No, it still picks from what's currently picked. I've used both extensively and they work as expected.

  • You could utilizing some character you aren't using in the text and the tokenat() expression. However it's easier to just make another global variable. You could also use an array or dictionary.

  • The textbox object can be used for your text editor. After that you can get the text with the Textbox.text expression. You can put that in a global variable or anywhere you'd like to put it so you can access it later. If you want to save from one run of the game to the next look at the local storage plugin.

  • Remove the the add and subtract actions, and then remove the conditions that compare the gear variable. It should look like what he typed above.

  • Those two conditions

    Text->compare variable

    And

    System->pick by comparison

    Should give identical results as you have pictures there. What are the differences you observe?

  • How do you get the screenshot as a gif?

    The simplest way would be to get a snapshot as a png first, then you can run some JavaScript with either the browser object or your own plugin. You would:

    1. Load the base64 into a image. This is done asycronously.

    2. When the image is loaded, draw that image to a canvas of the same size.

    3. Utilize a JavaScript gif library to take the canvas and spit out a base64 gif.

    Skipping to just 3 and using c2's canvas likely won't work when webgl is used. Otherwise notice you cannot get away from base64, so the buggy browsers you allude to will still have an issue. There are probably many gif JavaScript libraries you can find via Google. Any will do, and each is used differently.

    However if after taking the screenshot you just want to load it again then converting it to gif first is a needless step.

  • Here's one idea on how to bend the box around the corners.

    https://dl.dropboxusercontent.com/u/542 ... snake.capx

    There's probably a lot of simplification to be had.

  • Since the system now offers a reasonable z sorter I guess It really doesn't need it in the plug.

    Not really, this can handle sorting situations that the system condition can't handle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could check if the object's speed is zero. Most behaviors have some way to compare speed, alternatively you could save the object's position to some variables every tick and then right above that event check to see if the current position is different than the current. Probably you'll want small changes to count as not moving. Here's an example permitting anything less than 1 pixel as not moving.

    global number oldx=0

    global number oldy=0

    system compare abs(oldx-sprite.x) < 1

    system compare abs(oldy-sprite.y) < 1

    --- do something since the sprite isn't moving

    every tick

    --- set oldx to sprite.x

    --- set oldy to sprite.y

  • To save as a gif file you'd need to use some js library that can generate a gif because by default only png/jpg is supported. However it will still be a base64 image.

  • No worries, glad you got it working.