Page 1 of 1

(suggestion) please add a way to crop a image

Posted: Wed Apr 25, 2018 3:19 am
by Shadowblitz16
please add a way to crop images and textures!
something as simple as image.crop(x,y,w,h) would be fine as long as it returned a image or imagedata

this could be used to make 1d tilebanks like what the older consoles used without having to code a ton of exceptions for tilesheets like.. exporting,
importing,
format,
multiple pages.

Re: (suggestion) please add a way to crop a image

Posted: Wed Apr 25, 2018 4:53 am
by ivan
Are you aware that you can already draw cropped images using quads?

Re: (suggestion) please add a way to crop a image

Posted: Wed Apr 25, 2018 10:17 am
by unek
ImageData:paste does that

Re: (suggestion) please add a way to crop a image

Posted: Wed Apr 25, 2018 10:23 am
by pgimeno
unek wrote: Wed Apr 25, 2018 10:17 am ImageData:paste does that
I knew I was missing something.

Re: (suggestion) please add a way to crop a image

Posted: Thu May 03, 2018 8:59 am
by Guard13007
While it would be convenient, there are other options that should be learned if it needs to be dynamic in some way, and otherwise this is the kind of thing that should be done in a editor rather than in a game engine, no?

(Note: I am speaking out of my ass at least a little, as I do not understand Quads at all. I understand a little of the ImageData stuff, but not that.. >.>)

Re: (suggestion) please add a way to crop a image

Posted: Thu May 03, 2018 11:43 am
by zorg
Guard13007 wrote: Thu May 03, 2018 8:59 am While it would be convenient, there are other options that should be learned if it needs to be dynamic in some way, and otherwise this is the kind of thing that should be done in a editor rather than in a game engine, no?

(Note: I am speaking out of my ass at least a little, as I do not understand Quads at all. I understand a little of the ImageData stuff, but not that.. >.>)
I would say that Quads are dynamic enough, but ultimately if you want even more freedom, you can use a Mesh directly; that also allows you to have arbitrary shapes and vertex parameters, unlike Quads, that restrict you to quadrilaterals (each two sides parallel)