RBuster's Forum Posts

  • Here's a better approach I found after the link above.

    You set the viewport size to the size you want.

    Next scroll to the center of what you want to capture.

    Then use the snapshot canvas action.

    When it's done you can then set the viewport back to normal and scroll back so it's centered.

    Thanks for the reply.

    Sorry but I did not understand the difference between what I did and what you suggested.

    You have suggested the following in that post:

    You can use the Snapshot action instead. For for a 100x100 image centered on position 50x50 you could do this:

    ---Set canvas size to 100x100

    ---scroll to (50, 50)

    ---Take Snapshot

    on snapshot

    ---set canvas size to 640x480

    ---scroll to (320,240)

    ---invoke download of canvasScreenshot

    The second scroll to is to scroll back to the original scroll location. If the layout isn't using unbounded scrolling you could also use (0,0).

    Is it not the same?

    My code:

    Just to illustrate:

    Obs: The "screen" sprite is the grey rectangle and the canvas plugin is filling all the white area.

  • I am using canvas plugin and I need o get a snapshot from the specific area of the canvas. The canvas plugin is filling the entire screen (1280,720) but I just want an area in the middle of the screen, where is the sprite.

    I am using:

    Set canvas size (screen.width/screen.height)

    Set scroll to (screen.x/screen.y)

    And after take a snapshot I restore de original sizes and positions.

    The issue: I am not getting the area I want. The image seems offset. I have tried to use the values instead the sprite (screen) location/size but it is not working too.

    R0J0hound

    I saw your answer in this topic:

    I followed your instructions exactly but I am still having this issue.

  • On the browser plugin runtime.js line 54, I replaced

     let browserInstance = null;[/code:2gvziqek]
    with
    [code:2gvziqek] var browserInstance = null;[/code:2gvziqek]
    then I could use the minifier again. As a temporary solution it should work.
    

    Thanks Nemega

    This worked for me.

  • Hi nimos100

    I am having the same issue. I will be following this thread.

    Edited: Because this I cannot access my games through the safari browser, I presume.

  • So, I am doing this:

    Layout 1 (with drawing):

    On Left button clicked > Take snapshot of canvas

    On canvas snapshot > LocalStorage set item snapshot1 to CanvasSnapshot

    On item "snapshot1" set > Go to Layout2

    Layout2 (with another drawing):

    On Left button clicked > Take snapshot of canvas

    On canvas snapshot > LocalStorage set item snapshot2 to CanvasSnapshot

    On item "snapshot2" set > Go to Layout3

    Layout 3 (with sprites used to load the snapshots):

    On start of layout > LocalStorage | Check item "snapshot1" exists

    On start of layout > LocalStorage | Check item "snapshot2" exists

    On item "snapshot1" exists > sprite1 | Load image from LocalStorage.ItemValue

    On item "snapshot2" exists > sprite2 | Load image from LocalStorage.ItemValue

    I don't know if this is the best solution but it works for me. I hope it helps some one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You just need to move each image to a different x/y position and paste into the Canvas/Paster object. They need to be on-screen and visible to paste, so you could write a function to put all required images side by side, then create a Canvas/Paster object and set the size/resolution large enough to cover all of the images, set the viewport to the same size, paste, then save the file.

    When you say "move each image" you mean: move each sprite with the image loaded? I can use Canvas "or" Paster, right? This function uses array? I don't know how to use array to manager positions. Wiil I need to use a new layout to prepare this huge composition? My current layout has only 640x480. This is very hard for me.

  • > Is it possible to save 20 snapshots on disk, load them after into a tilemap and so get a snapshot from this and print or save as image?

    >

    its possible if you dont want to use paster plugin or other complicated thing, you just create a global sprite, and create a instance of it everytime a drawing is made, save the snapshot url to a frame inside the sprite, then when the user wants to print it, use an positioning in screen for x and for y loopindex array kind of thing, then canvassnapshot again, and invoke the browser.execute javascript call .print to print the newly canvassnapshoturl its going to take a while for you to implement it but its the easiest way of doing it and without non-default plugins.

    when you call the print in javascript you use the same javascript you call the print from a html5 website ("javascript:window.print('canvassnapshoturl') ") just you need to change the scripts brackets to single ones ex: "myjavascript code { something 'blob code ,etc' } "

    Could you make a simple example of this?

  • > Is it possible to save 20 snapshots on disk, load them after into a tilemap and so get a snapshot from this and print or save as image?

    >

    You could use the Canvas or Paster plugins to composite all of the snapshots and then save the results to a single file.

    It seems promising. Can I find any example about of how to composite images with Canvas or even Paster (though I have never used this plugin)? Do you have one?

  • Is it possible to save 20 snapshots on disk, load them after into a tilemap and so get a snapshot from this and print or save as image?

  • Thanks guys. But I really need more tips of how to print the drawing and I think I will have a situation here to solve: I need to print all the drawings in same page, like a tile. For example: If the player paint 20 drawing all this drawing should be distributed in the page (1 columns x 6 rows + 2 columns x 7 rows) when they print them. Can I do that?

    Thanks in advance.

  • Thanks for the indication X3M

    Thanks for the reply I have checked the app. Very nice.

    Is it possible to print the colourful drawing at the end?

  • This is not very exciting. Any other opinion/suggestion/help?

  • Hi everybody

    I know that it's possible to create a paint game in the C2 but I need to know if it is possible to do it with all these requirements:

    • the drawings are outline images (probably rasterised vector images)
    • fill the drawings with color including the background (it's not necessary the brush tool)
    • at the end the player can print the drawing

    I know I can use the canvas plugin for this but I don't if it attends all the requirements and if the final quality is good.

    Thanks in advance for any help/demonstration/suggestion?

  • Here's an example of it in action:

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

    Basically look at every pair of lists with two loops like I mentioned above. Families can be used to pick both at once or you can just pick each individually like in the capx. In the capx I copy the list over to an array, and then sort the array. Next if the number of items is the same we can compare each item and see if they're equal, and if they are you can mark those lists as no unique.

    A BIG THANK YOU!!! I will analyse each line of this capx to really understand what I would have to have done to create it. Thanks a lot for each millisecond of the time that you have spent on it.

  • I will create an example for you understand what I am doing in a few minutes.