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.

Methods

Public Class methods

Creates a new Cursor.

[Source]

/*
  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;
}

Public Instance methods

Returns the rect in which the cursor can move.

[Source]

/*
  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.

[Source]

/*
  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.

[Source]

/*
  Returns the cursor's sensibility.
*/
VALUE Cursor_sensibility(VALUE self)
{
   Cursor &ref = getRef<Cursor>(self);
   return INT2FIX(ref.getSensibility());
}
sensibility=(p1)

Alias for setSensibility

Changes the cursor sensibility.

[Source]

/*
  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;
}

Moves the cursor automatically.

[Source]

/*
  Moves the cursor automatically.
*/
VALUE Cursor_updatePos(VALUE self)
{
   Cursor &ref = getRef<Cursor>(self);
   ref.updatePos();

   return Qnil;
}
update_pos()

Alias for updatePos

[Validate]