How do I get the real X, Y, Width & Height when Full screen scaling?

0 favourites
  • 2 posts
From the Asset Store
Is a circular loading screen with code ready to use. No Animation.
  • I have a sprite (which I use as a photo, so rectangular), I then take a snapshot of the canvas and simply want to capture only the rectangle sprite (the photo).

    So, most obvious choice when using "take snapshot canvas" is to set the X & Y position to the sprite X & Y, and same with the width & height (sprite width & height).

    However this only works if full screen scaling is set to off, if it is anything else such as Scale Inner/Outer, then the captured snapshot is never the right place or size?

    I have also tried using "photo.height*PlatformInfo.DevicePixelRatio" but still no luck, this just changes things but still not correct.

    When I run in Debug mode and look at the sprite in question, the width, height and scale doesn't change regardless of the canvas scale??

    So how do I get these values to get a correct snapshot??

    Andy

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think , I might have found a solution, weather it is the best way im not sure.

    Width in this case is always the width of the canvas, so easy to just use the canvas width.

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