Class: Raylib::Vector2

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib_main.rb,
lib/raylib_helper.rb

Overview

Math helper

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.copy_from(vec) ⇒ Object



61
62
63
# File 'lib/raylib_helper.rb', line 61

def self.copy_from(vec)
  Vector2.create(vec[:x], vec[:y])
end

.create(x = 0, y = 0) ⇒ Object



57
58
59
# File 'lib/raylib_helper.rb', line 57

def self.create(x = 0, y = 0)
  Vector2.new.set(x, y)
end

Instance Method Details

#set(x, y) ⇒ Object



65
66
67
68
69
# File 'lib/raylib_helper.rb', line 65

def set(x, y)
  self[:x] = x
  self[:y] = y
  self
end

#xObject



419
# File 'lib/raylib_main.rb', line 419

def x = self[:x]

#x=(v) ⇒ Object



420
# File 'lib/raylib_main.rb', line 420

def x=(v) self[:x] = v end

#yObject



421
# File 'lib/raylib_main.rb', line 421

def y = self[:y]

#y=(v) ⇒ Object



422
# File 'lib/raylib_main.rb', line 422

def y=(v) self[:y] = v end