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+.
Creates a new Painter linked to a buffer.
/* 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; }
Clears the buffer in a color.
/* call-seq: clear(color) Clears the buffer in a color. */ VALUE Painter_clear(VALUE self, VALUE col)
Draws a buffer on a buffer.
/* 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.
/* 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.
/* 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.
/* 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.
/* 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.
/* 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.
/* 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)