Creating Image(s) on the fly
Creating Image(s) on the fly
Is it possible to create Image objects on the fly and draw/blt on them? I could be missing something obvious here; I see there is love.image.newImageData, but it's unclear to me how you can draw or blit onto that image. Thanks.
Re: Creating Image(s) on the fly
Sort of.
Framebuffers would be best suited for what you're describing. Although framebuffers tend to break older hardware.
Alternatively if you really, really want to use images you can save the image data when you load it and then just paste what you want into a screen-sized image data and then turn it into an image and draw it. That is probably a bit slow though depending on your screen scaling and resolution.
Framebuffers would be best suited for what you're describing. Although framebuffers tend to break older hardware.
Alternatively if you really, really want to use images you can save the image data when you load it and then just paste what you want into a screen-sized image data and then turn it into an image and draw it. That is probably a bit slow though depending on your screen scaling and resolution.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Creating Image(s) on the fly
There are two ways to draw to ImageData objects. You can play with individual pixels, in which case ImageData:setPixel, ImageData:mapPixel, and ImageData:getPixel are your friends. You can also paste other ImageData objects into an ImageData object using ImageData:paste.
Re: Creating Image(s) on the fly
This might be good enough for my current purposes. Thanks. It would be great if the "draw" functions in love.graphics were replicated for images as well...BlackBulletIV wrote:There are two ways to draw to ImageData objects. You can play with individual pixels, in which case ImageData:setPixel, ImageData:mapPixel, and ImageData:getPixel are your friends. You can also paste other ImageData objects into an ImageData object using ImageData:paste.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Creating Image(s) on the fly
Framebuffers exist for this very reason.
Who is online
Users browsing this forum: Semrush [Bot] and 3 guests