class Dare::ImageTile

Attributes

height[R]
width[R]

Public Class Methods

new(image = Image.new, x = 0, y = 0, width = 0, height = 0) click to toggle source
# File lib/dare/image.rb, line 202
def initialize(image = Image.new, x = 0, y = 0, width = 0, height = 0)
  @image = image
  @x = x
  @y = y
  @width = width
  @height = height
end

Public Instance Methods

draw(x = 0, y = 0, opts = {}) click to toggle source
# File lib/dare/image.rb, line 210
def draw(x = 0, y = 0, opts = {})
  @image.draw_tile(x, y, opts.merge({sx: @x, sy: @y, swidth: @width, sheight: @height}))
end
draw_rot(x = 0, y = 0, angle = 90, opts = {}) click to toggle source
# File lib/dare/image.rb, line 214
def draw_rot(x = 0, y = 0, angle = 90, opts = {})
  @image.draw_tile_rot(x, y, angle, opts.merge({sx: @x, sy: @y, swidth: @width, sheight: @height}))
end