Class: Rubygame::ActiveEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/rubygame/event.rb

Overview

Indicates that the Rubygame window has gained or lost focus from the window manager.

This event has these attributes:

gain

true if the window gained focus, and false if it lost focus.

state

string indicating what type of focus was gained or lost:

“mouse”

the mouse entered/exited the window

“keyboard”

the window gained or lost input focus

“active”

the window was minimized/iconified.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gain, state) ⇒ ActiveEvent

Returns a new instance of ActiveEvent.



167
168
169
170
# File 'lib/rubygame/event.rb', line 167

def initialize(gain,state)
	@gain = gain
	@state = state 
end

Instance Attribute Details

#gainObject

Returns the value of attribute gain.



166
167
168
# File 'lib/rubygame/event.rb', line 166

def gain
  @gain
end

#stateObject

Returns the value of attribute state.



166
167
168
# File 'lib/rubygame/event.rb', line 166

def state
  @state
end