-
Notifications
You must be signed in to change notification settings - Fork 0
Minigame::Image
bggd edited this page Jan 31, 2014
·
10 revisions
# Class Methods
Image.new(width, height, color = Color.rgb(255, 255, 255))
Image.load(filepath)
Image.target(img) do
# drawing stuff
end
Image.hold_drawing(bool)
Image.hold_drawing?
# Instance Attributes
img = Image.load("hero.png")
img.w
img.h
# Instance Methods
# angle - 0..360
img.draw(x, y, :angle => 0,
:color => Color.rgb(255, 255, 255),
:region => [0, 0, img.w, img.h],
:scale => [1.0, 1.0],
:anchor => [0.0, 0.0],
:pivot => [0.5, 0.5],
:flip => [false, false])
img.sub_image(x = 0, y = 0, width = img.w, height = img.h)
img.clear(color = Color.rgb(255, 255, 255))
# Convert the given mask color to an alpha channel in the image
img.convert_mask_to_alpha(mask_color)