Method: Gosu::Image#subimage

Defined in:
rdoc/gosu.rb

#subimage(left, top, width, height) ⇒ Image?

Returns an image that is a smaller, rectangular view of this Gosu::Image.

This is a very fast operation, and no new textures will be allocated. If you update this Gosu::Image or the #subimage using #insert, the other Gosu::Image will be affected as well.

Caveats:

  • If you stretch or rotate a #subimage, the pixels adjacent to it might bleed into it, as Gosu does not manage the ‘tileability’ of subimages.

Returns:

  • (Image?)

    an image that represents a portion of the containing image



457
# File 'rdoc/gosu.rb', line 457

def subimage(left, top, width, height); end