nandeck-ruby/lib/nandeck/primitives/image.rb
2013-10-09 22:51:03 -04:00

21 lines
589 B
Ruby

module Nandeck
class Image < Primitive
attr_reader :card_index, :filename, :x, :y, :width, :height, :options
def initialize(card_index, filename, x, y, width, height, options = {})
options = {
angle: 0,
flag: "PN",
alpha_channel: 100
}.merge(options)
@card_index, @filename, @x, @y, @width, @height, @options = card_index, filename, x, y, width, height, options
end
def to_s
%{IMAGE = #{@card_index}, "#{@filename}", #{geometry}, #{@options[:angle]}, #{@options[:flag]}, #{@options[:alpha_channel]}}
end
end
end