Parent

Methods

Class/Module Index [+]

Quicksearch

Rubygame::Events::WindowResized

WindowResized is an event that occurs when the Rubygame application window is resized by the user. This can only happen if the Screen mode was set with the "resizable" flag.

Your application should respond to this event by setting the Screen mode again with the new size and redrawing.

If you ignore this event, the "active" area of the Screen will stay the same size, and the rest (if the window was enlarged) will be black and won't receive any changes (blits, drawing, etc.).

Attributes

size[R]

Public Class Methods

new( size ) click to toggle source
# File lib/rubygame/events/misc_events.rb, line 124
def initialize( size )

  @size = size.to_ary.dup
  @size.freeze

  unless @size.length == 2
    raise ArgumentError, "size must have exactly 2 parts (got %s)"%@size.length
  end

  @size.each do |part|
    if part <= 0
      raise ArgumentError, "size must be positive (got %s)"%part
    end
  end

end

[Validate]

Generated with the Darkfish Rdoc Generator 2.