Class Joyau::Scrolling
In: Drawable.cpp
Parent: Joyau::Drawable

Class which displays a Sprite twice, making it scroll in one of the four direction.

Methods

dir   dir=   direction   direction=   new   play   setDir   setSpeed   setSprite   speed   speed=   sprite=  

Constants

LEFT = INT2FIX(Sprite::LEFT)
RIGHT = INT2FIX(Sprite::RIGHT)
UP = INT2FIX(Sprite::UP)
DOWN = INT2FIX(Sprite::DOWN)

Public Class methods

Creates a new Scrolling. You can eventually load a picture during this creation.

[Source]

/*
  call-seq: new
            new(filename)

  Creates a new Scrolling. You can eventually load a picture during this
  creation.
*/
VALUE wrap<Scrolling>(int argc, VALUE *argv, VALUE info)
{
   Scrolling *ptr = new Scrolling;

   if (argc >= 1)
      ptr->setSprite(StringValuePtr(argv[0]));
   
   VALUE tdata = Data_Wrap_Struct(info, 0, wrapped_free<Scrolling>, ptr);
   return tdata;
}

Public Instance methods

Returns the scrolling’s directory.

[Source]

/*
  Returns the scrolling's directory.
*/
VALUE Scrolling_dir(VALUE self)
{
   Scrolling &ref = getRef<Scrolling>(self);
   return INT2FIX(ref.getDir());
}
dir=(p1)

Alias for setDir

direction()

Alias for dir

direction=(p1)

Alias for setDir

Moves the scrolling,a nd wraps it automatically.

[Source]

/*
  Moves the scrolling,a nd wraps it automatically.
*/
VALUE Scrolling_play(VALUE self)
{
   Scrolling &ref = getRef<Scrolling>(self);

   ref.play();
   return Qnil;
}

Sets the scrolling direction

[Source]

/*
  call-seq: setDir(dir)

  Sets the scrolling direction
*/
VALUE Scrolling_setDir(VALUE self, VALUE dir)
{
   Scrolling &ref = getRef<Scrolling>(self);
   int _dir = FIX2INT(dir);
   
   ref.setDir(_dir);
   return dir;
}

Sets the scrolling speed. The speed is the distance that is done by the scrolling at each call to play.

[Source]

/*
  call-seq: setSpeed(s)

  Sets the scrolling speed.
  The speed is the distance that is done by the scrolling at each call to
  play.
*/
VALUE Scrolling_setSpeed(VALUE self, VALUE s)
{
   Scrolling &ref = getRef<Scrolling>(self);
   int speed = FIX2INT(s);
   
   ref.setSpeed(speed);
   return s;
}

Loads a picture for the scrolling.

[Source]

/*
  call-seq: setSprite(filename)

  Loads a picture for the scrolling.
*/
VALUE Scrolling_setSprite(VALUE self, VALUE spr)
{
   Scrolling &ref = getRef<Scrolling>(self);
   char *str = StringValuePtr(spr);

   ref.setSprite(str);
   return spr;
}

Returns the scrolling’s speed.

[Source]

/*
  Returns the scrolling's speed.
*/
VALUE Scrolling_speed(VALUE self)
{
   Scrolling &ref = getRef<Scrolling>(self);
   return INT2FIX(ref.getSpeed());
}
speed=(p1)

Alias for setSpeed

sprite=(p1)

Alias for setSprite

[Validate]