Method: RGSS::Texture#to_image
- Defined in:
- lib/rgss/texture.rb
#to_image ⇒ Object
91 92 93 94 95 |
# File 'lib/rgss/texture.rb', line 91 def to_image pixels = "\0" * @width * @height * 4 bind_framebuffer { glReadPixels(0, 0, @width, @height, GL_RGBA, GL_UNSIGNED_BYTE, pixels) } Image.new(@width, @height, pixels) end |