| Class | Joyau::Cursor |
| In: |
Drawable.cpp
|
| Parent: | Joyau::Sprite |
This is a kind of Sprite which moves according to the analogic stick’s move. If its “sensibility” is greater, it’ll move slower.
Creates a new Cursor.
/*
call-seq: new
new(filename [, sensibility])
Creates a new Cursor.
*/
VALUE wrap<Cursor>(int argc, VALUE *argv, VALUE info)
{
Cursor *ptr = new Cursor;
VALUE tdata;
if (argc >= 1)
{
ptr->setPicture(StringValuePtr(argv[0]));
if (argc >= 2)
ptr->setSensibility(FIX2INT(argv[1]));
}
tdata = Data_Wrap_Struct(info, 0, wrapped_free<Cursor>, ptr);
return tdata;
}
Returns the rect in which the cursor can move.
/*
Returns the rect in which the cursor can move.
*/
VALUE Cursor_rect(VALUE self)
{
Cursor &ref = getRef<Cursor>(self);
Rect ret = ref.getRect();
return createObject(getClass("Rect"), ret);
}
Sets the rect in which the cursor can move.
/*
call-seq: setRect(rect)
Sets the rect in which the cursor can move.
*/
VALUE Cursor_setRect(VALUE self, VALUE rect)
{
Cursor &ref = getRef<Cursor>(self);
Rect &arg = getRef<Rect>(rect);
ref.setRect(arg);
return Qnil;
}
Returns the cursor’s sensibility.
/*
Returns the cursor's sensibility.
*/
VALUE Cursor_sensibility(VALUE self)
{
Cursor &ref = getRef<Cursor>(self);
return INT2FIX(ref.getSensibility());
}
Changes the cursor sensibility.
/*
call-seq: setSensibility(val)
Changes the cursor sensibility.
*/
VALUE Cursor_setSensibility(VALUE self, VALUE s)
{
Cursor &ref = getRef<Cursor>(self);
int sens = FIX2INT(s);
ref.setSensibility(sens);
return Qnil;
}