class Core::GUI::Image

Attributes

color[RW]

Public Class Methods

new(x, y, img) click to toggle source
Calls superclass method Core::GUI::Element::new
# File lib/gui/image.rb, line 6
def initialize(x, y, img)
  @img = Core.sprite("gui/#{img}")
  w, h, = @img.width, @img.height
  super(x, y, w, h)
  @color = Gosu::Color.new(255, 255, 255, 255)
end

Public Instance Methods

draw() click to toggle source
# File lib/gui/image.rb, line 12
def draw
  @img.draw(@x, @y, Core::GUI_Z + 10, 1, 1, @color)
end