Created
February 3, 2012 01:16
-
-
Save ruprict/1726900 to your computer and use it in GitHub Desktop.
ROFLBALT Renderable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Renderable | |
def each_pixel ticks | |
(y...(y + height)).each do |y| | |
(x...(x + width)).each do |x| | |
rx = x - self.x | |
ry = y - self.y | |
yield x, y, pixel(x, y, rx, ry, ticks) | |
end | |
end | |
end | |
def right_x; x + width end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment