Method: Fidgit::ImageFrame#initialize

Defined in:
lib/fidgit/elements/image_frame.rb

#initialize(image, options = {}) ⇒ ImageFrame

Returns a new instance of ImageFrame.

Parameters:

  • image (Gosu::Image)

    Gosu image to display.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :thumbnail (Boolean) — default: false

    Is the image expanded to be square?



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fidgit/elements/image_frame.rb', line 16

def initialize(image, options = {})
  options = {
      thumbnail: false,
      factor: 1,
  }.merge! options

  @thumbnail = options[:thumbnail]
  @factor_x = options[:factor_x] || options[:factor]
  @factor_y = options[:factor_y] || options[:factor]

  super(options)

  self.image = image
end