Method: Fidgit::DialogState#initialize

Defined in:
lib/fidgit/states/dialog_state.rb

#initialize(options = {}) ⇒ DialogState

Returns a new instance of DialogState.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fidgit/states/dialog_state.rb', line 11

def initialize(options = {})
  # @option options [Gosu::Color] :shadow_color (transparent black) Color of the shadow.
  # @option options [Gosu::Color] :shadow_offset (8) Distance shadow is offset to bottom and left.
  # @option options [Gosu::Color] :shadow_full (false) Shadow fills whole screen. Ignores :shadow_offset option if true.
  options = {
    shadow_color: DEFAULT_SHADOW_COLOR,
    shadow_offset: DEFAULT_SHADOW_OFFSET,
    shadow_full: false,
  }.merge! options

  @shadow_color = options[:shadow_color].dup
  @shadow_offset = options[:shadow_offset]
  @shadow_full = options[:shadow_full]

  super()
end