Class | SFML::Vector2 |
In: |
system/Vector3.cpp
|
Parent: | Object |
SFML::Vector2 is a simple class that defines a mathematical vector with two coordinates (x and y).
It can be used to represent anything that has two dimensions: a size, a point, a velocity, etc.
This class differs from the C++ version. It will accept any value that is Numeric and both x and y must be of the same class.
v1 = SFML::Vector2.new(16.5, 24.0) v1.x = 18.2 y = v1.y v2 = v1 * v1; v3 = SFML::Vector2.new v3 = v1 + v2 different = (v2 != v3);
x | [RW] | |
y | [RW] |