How do I make an snapshot and keep the position and height and width?

0 favourites
  • 6 posts
  • Hi, I am making a simple avatar game, when the game is full screen there are no problem making a snapshot of the avatar (only a region inside of the layout).

    BUT if I resize the screen the snapshot take other posición and if the resolution is smaller... the I get a full snapshot... but I only need the avatar.

    Here is my action, BODY are the avatar.

    thanks on advance!

    Best

  • Your are adding 40px margin on the left and top of the snapshot, but you didn't add the same margin to the right and bottom. I think you need to change it to Body.Width+80 , Body.Height+80

  • That not a problem.

    Because I tested without adding or subreact anything.

    The position of the snapshot change when I resize the screen.

  • According to the documentation:

    So you need something like this:

    .

  • Hi!

    Thanks for the response... actually I modify the script like this and works perfect.

    Here is the new version of the script, can be better change the numbers for screen width and height.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your response is very helpful. On the current Construct 3 release, I broke the actual snapshot into two steps, each trigger by a button. After requesting the camera source (event #1), I take a photo with User Media when the Go button is pressed (#3). The Stop turns the video into a photo. When the snapshot is ready (#4), I load it into my Me sprite (500 X 500). Or is it me My sprite, OK lost my train of thought.

    I have an overlay (called Overlay) that is over Me. Basically a frame, with the photo underneath.

    Next when I'm ready to download the photo and frame with the Download button (#5), I figure out the pixels on the screen using HeightFactor and WidthFactor variables. Then I take a snapshot of my canvas using the Overlay to guide my offsets and width/height of the snapshot. When the canvas snapshot is ready (#6), I download using the Browser.

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