Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created February 3, 2012 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruprict/1726900 to your computer and use it in GitHub Desktop.
Save ruprict/1726900 to your computer and use it in GitHub Desktop.
ROFLBALT Renderable
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