Class Joyau::Painter
In: Drawable.cpp
Parent: Object

This class allows to write easily in a buffer, at anytime. You can specify the buffer it is linked with at construction time, or get a painter through +Joyau::draw+.

Methods

Public Class methods

Creates a new Painter linked to a buffer.

[Source]

/*
  call-seq: new(buffer)

  Creates a new Painter linked to a buffer.
*/
VALUE wrap<Painter>(int argc, VALUE *argv, VALUE info)
{
   VALUE buffer;
   rb_scan_args(argc, argv, "1", &buffer);

   Painter *ptr = new Painter(getRef<Buffer>(buffer));
   VALUE tdata = Data_Wrap_Struct(info, 0, wrapped_free<Painter>, ptr);
   return tdata;
}

Public Instance methods

Clears the buffer in a color.

[Source]

/*
  call-seq: clear(color)

  Clears the buffer in a color.
*/
VALUE Painter_clear(VALUE self, VALUE col) 

Draws a buffer on a buffer.

[Source]

/*
  call-seq: drawBuffer(x, y, buffer)

  Draws a buffer on a buffer.
*/
VALUE Painter_drawBuffer(VALUE self, VALUE x, VALUE y, VALUE buffer) 

Draws a circle on the buffer.

[Source]

/*
  call-seq: drawCircle(x, y, radius, col)

  Draws a circle on the buffer.
*/
VALUE Painter_drawCircle(VALUE self, VALUE x, VALUE y, VALUE r, VALUE col) 

Draws a filled circle on the buffer.

[Source]

/*
  call-seq: drawFillCircle(x, y, radius, col)

  Draws a filled circle on the buffer.
*/
VALUE Painter_drawFillCircle(VALUE self, VALUE x, VALUE y, VALUE r, VALUE col) 

Draws a filled rect on the buffer.

[Source]

/*
  call-seq: drawLine(x1, y1, x2, y2, col1, col2 = nil, col3 = nil, col4 = nil)

  Draws a filled rect on the buffer.
*/
VALUE Painter_drawFillRect(int argc, VALUE *argv, VALUE self) 

Draws a line on the buffer.

[Source]

/*
  call-seq: drawLine(x1, y1, x2, y2, col1, col2 = nil)

  Draws a line on the buffer.
*/
VALUE Painter_drawLine(int argc, VALUE *argv, VALUE self) 

Draws a point on the buffer.

[Source]

/*
  call-seq: drawPoint(x, y, col)

  Draws a point on the buffer.
*/
VALUE Painter_drawPoint(VALUE self, VALUE x, VALUE y, VALUE col) 

Draws a rect on the buffer.

[Source]

/*
  call-seq: drawRect(x1, y1, x2, y2, col1, col2 = nil, col3 = nil, col4 = nil)

  Draws a rect on the buffer.
*/
VALUE Painter_drawRect(int argc, VALUE *argv, VALUE self) 

Draws a tiangle on the buffer.

[Source]

/*
  call-seq: drawTriangle(x1, y1, x2, y2, x3, y3, col1, col2 = nil, col3 = nil)

  Draws a tiangle on the buffer.
*/
VALUE Painter_drawTriangle(int argc, VALUE *argv, VALUE self) 

[Validate]