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)
-
- (Integer) x
X coordiante of the point.
-
- (Integer) y
Y coordiante of the point.
Instance Method Summary (collapse)
-
- (SDL2::Point) initialize
constructor
Create a new point object.
-
- (String) inspect
Return inspection string.
Constructor Details
- (SDL2::Point) initialize(x, y) - (SDL2::Point) initialize
Create a new point object.
2454 2455 2456 2457 2458 2459 2460 2461 2462 |
# File 'video.c', line 2454
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
- (Integer) x
X coordiante of the point.
- (Integer) y
Y coordiante of the point.
Instance Method Details
- (String) inspect
Return inspection string.
2468 2469 2470 2471 2472 |
# File 'video.c', line 2468
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);
}
|