Class: Rubydraw::Events::FocusGain

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

Overview

Created when the window gains focus, e.g. clicking on the window after previously using another application.

Class Method Summary collapse

Methods inherited from FocusEvent

matching_sdl_type, wants_to_match?

Methods inherited from Event

#event?, from_sdl_event, matching_sdl_type, wants_to_match?

Class Method Details

.matches?(sdl_event) ⇒ Boolean

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

Returns:

  • (Boolean)


231
232
233
234
235
236
# File 'lib/rubydraw/events.rb', line 231

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