Class: SDL2::Point

Inherits:
Struct
  • Object
show all
Defined in:
lib/sdl2/point.rb

Class Method Summary collapse

Methods inherited from Struct

#==, #initialize, release

Methods included from StructHelper

#member_readers, #member_writers

Constructor Details

This class inherits a constructor from SDL2::Struct

Class Method Details

.cast(something) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/sdl2/point.rb', line 10

def self.cast(something)
  if something.kind_of?(Array) and something.count == 2
    something.map!(&:to_i) 
    result = Point.new
    result.x, result.y = something
    return result
  else      
    return super
  end
end