Class: SDL2::Point
- Inherits:
-
Object
- Object
- SDL2::Point
- Defined in:
- video.c,
video.c
Overview
This class represents a point in SDL library. Some method requires this method.
Instance Attribute Summary collapse
-
#x ⇒ Integer
X coordiante of the point.
-
#y ⇒ Integer
Y coordiante of the point.
Instance Method Summary collapse
-
#initialize(*args) ⇒ SDL2::Point
constructor
Create a new point object.
-
#inspect ⇒ String
Return inspection string.
Constructor Details
#initialize(x, y) ⇒ SDL2::Point #initialize ⇒ SDL2::Point
Create a new point object.
2605 2606 2607 2608 2609 2610 2611 2612 2613 |
# File 'video.c', line 2605
static VALUE Point_initialize(int argc, VALUE* argv, VALUE self)
{
VALUE x, y;
SDL_Point* point = Get_SDL_Point(self);
rb_scan_args(argc, argv, "02", &x, &y);
point->x = (x == Qnil) ? 0 : NUM2INT(x);
point->y = (y == Qnil) ? 0 : NUM2INT(y);
return Qnil;
}
|
Instance Attribute Details
#x ⇒ Integer
X coordiante of the point.
#y ⇒ Integer
Y coordiante of the point.
Instance Method Details
#inspect ⇒ String
Return inspection string.
2619 2620 2621 2622 2623 |
# File 'video.c', line 2619
static VALUE Point_inspect(VALUE self)
{
SDL_Point* point = Get_SDL_Point(self);
return rb_sprintf("<SDL2::Point x=%d y=%d>", point->x, point->y);
}
|