cut out a part of a screen and draw it
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
cut out a part of a screen and draw it
so its like print screen/capture screen, but only at a specific part of the screen, like capturing half part of the screen, and then draw it.. is it possible ?
- Sir_Silver
- Party member
- Posts: 286
- Joined: Mon Aug 22, 2016 2:25 pm
- Contact:
Re: cut out a part of a screen and draw it
You can use love.graphics.newScreenshot to capture imagedata of your love window, but nothing outside of it.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: cut out a part of a screen and draw it
If you do mean only a part of the game window/screen area contents though, then you can do it one of two ways:
- if you're specifically using a canvas there already, like for example, multiple small viewports in games like the settlers 2 or transport tycoon, then you can do that by getting the imagedata from the canvas itself;
- otherwise, you need to get the whole thing the way sir_silver said, and crop it after, probably by creating an ImageData with a smaller size, and using mapPixel on it.
- if you're specifically using a canvas there already, like for example, multiple small viewports in games like the settlers 2 or transport tycoon, then you can do that by getting the imagedata from the canvas itself;
- otherwise, you need to get the whole thing the way sir_silver said, and crop it after, probably by creating an ImageData with a smaller size, and using mapPixel on it.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: cut out a part of a screen and draw it
If you just want to draw it, can't you just the entire screen to a Canvas when you want to create the "screenshot", then draw part of that Canvas with a Quad?
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests