anyone have some ideas on this...

0 favourites
  • 14 posts
  • I would like to on left button clicked capture what ever is in a certain area as if i were taking a picture... so say I have a 150x150 pixel square attached to my mouse position and when I mouse click if there is anything in that area of view it would capture a picture of it... send it somewhere so I can view it in game after.... possible?

    Edit 1 - would be nice if when you click the left mouse button and are over the pink square or slightly over it whatever part of that pink square is inside the viewfinder it like snaps a picture of it...possible

    Edit 2 - I'm looking at the https://www.scirra.com/manual/125/system-actions snapshot canvas and curious even after reading the manual on it.. where do these snapshots get stored? how do I access them after taking one?

  • Ok so I got it working where as I can move the camera around and get a snapshot of the canvas exported to the bottom half the screen - now I need to figure out a way to JUST capture the center viewport of the image rather than snapshot of the entire screen.... any ideas?

  • If you are not against that, the paster plugin might be perfect for you:

    basically a paster is a rectangle where you "snapshot" a part of the layout, then you just display it.

  • says its for r160 does that matter that were on r195 now?

    Edit : how you install plugins I created a new folder in exporters->html5->plugins and pasted the file downloaded fromy our link but it failed to load given an error

  • That means that the plugin needs to be updated to account for changes in the Construct client between r160 and r195.

  • ok and with that being said - is there another version or another plugin that would act the same way... I just wanting to take a canvas shot of a certain area only - NOT the whole screen and then save that image to later use

  • The current version available there works perfectly with r195 - the one that's a .c2addon file. Just drag that file into an open C2 window and it will auto-install.

  • It's definitely something that should be added to the System object, something like "Snapshot canvas area", that triggers the same "On canvas snapshot" event.

    Here's a rather hacky way to do it with ExecJS. Note that it only works with WebGL off.

  • lmao Magistross hacks it again... ok so is there anything I would normally be working with that would require WebGL be on??

    Edit - Hey Magistross can you look at that file again for me and just tell me why when I add to 5&6 view_pot.Width - 5 and so forth that it don't scale the same as the outter one??

    Edit 2 - Hmm I notice however that doing it this way I have no record of the previously captured images... the other system built function produces what I assumed was a reusable data link to the captured image... the idea here is to be able to store multiple screen captures for later use.... 1st image captures who in carrier, if another shot is taking carrier2 right beside carrier one ext.. and Magistross if you wouldn't mind checking your PM

  • You can save the resulting data URI in a variable, instead of directly loading it in the sprite, then you'll have your "history" of snaps.

  • in regards to identifying how much of the OBJECT was captured in the view_port Magistross would using anything like the overlapping at offset work in anyway... say at the time of snapping the screenshot the view_port is overlapping the OBJECT 25% would that be a recordable figure???

  • desjardins2014: Please do not use the report option for "feature suggestions", that's not the purpose of the feature.

    Moreover, instead of posting multiple posts in a row, use the "Edit" feature in the top right corner of your posts. It limits the noise you make in the forums as well as the number of posts you produce in an hour and make them more "useful".

    Last and only warning.

    This is a forum, not a chat. Be more considerate when posting.

  • I just wanting to take a canvas shot of a certain area only - NOT the whole screen and then save that image to later use

    Can't open your file, it's saved as version 195 am on a lower version... but here's how i did it for my game:

    Say the area you want to clip is placed under object (for example a 9patch with a thin frame) called "Viewfinder".

    Create two global variables, OriginalCanvasW and OrginalCanvasH.

    System>On start of layout:

    set OriginalCanvasW = OriginalWindowWidth

    set OriginalCanvasH = OriginalWindowHeight

    Create two functions "ClipSave", called when you click your save button, and "ClipReset", called when "System>On Canvas Snapshot" is fired.

    ClipSave:

    System>Set Canvas Size to Viewfinder.Width x Viewfinder.Height

    System>Take Snapshot of Canvas

    ClipReset:

    Do what you need to do with the snapshot (for example Browser>Invoke download of CanvasSnapshot with filename "mysnapshot")

    System>Set Canvas Size to OriginalCanvasW x OriginalCanvasH

    Hope this helps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There ya go, enjoy

    Snapshot selected area / Clipped Snapshot:

    Demo (click to save snapshot) will be linked here once i have enough rep points

    Capx:

    [attachment=0:1yh1xgfa][/attachment:1yh1xgfa]

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)