Class Rubygame::Events::WindowResized
In: lib/rubygame/events/misc_events.rb
Parent: Object

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.).

Methods

new  

Attributes

size  [R] 

Public Class methods

[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]