Class: Rubydraw::Events::FocusGain

Inherits:
FocusEvent show all
Defined in:
lib/rubydraw/events.rb

Overview

Created when the window gains focus.

Class Method Summary collapse

Methods inherited from FocusEvent

matching_sdl_type

Methods inherited from Event

#event?, from_sdl_event, matching_sdl_type

Class Method Details

.matches?(sdl_event) ⇒ Boolean

Redefine Event#matches? because both this class and Rubydraw::Events::FocusLoss use SDL::ActiveEvent.

Returns:

  • (Boolean)


216
217
218
219
220
221
222
# File 'lib/rubydraw/events.rb', line 216

def self.matches?(sdl_event)
  result = false
  if super(sdl_event)
    result = sdl_event.gain == 1
  end
  result
end

.wants_to_match?Boolean

Returns:

  • (Boolean)


210
211
212
# File 'lib/rubydraw/events.rb', line 210

def self.wants_to_match?
  true
end