ScreenPainter

The 2D drawing proxy. You acquire one of these with SimpleWindow.draw rather than constructing it directly. Then, it is reference counted so you can pass it at around and when the last ref goes out of scope, the buffered drawing activities are all carried out.

More...
struct ScreenPainter {}

Constructors

this
this(CapableOfBeingDrawnUpon window, NativeWindowHandle handle)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

clear
void clear()
copyActiveOriginals
void copyActiveOriginals()
Undocumented in source. Be warned that the author may not have intended to support it.
drawArc
void drawArc(Point upperLeft, int width, int height, int start, int finish)
Undocumented in source. Be warned that the author may not have intended to support it.
drawEllipse
void drawEllipse(Point upperLeft, Point lowerRight)

Arguments are the points of the bounding rectangle

drawImage
void drawImage(Point upperLeft, Image i, Point upperLeftOfImage, int w, int h)
drawLine
void drawLine(Point starting, Point ending)

Draws a pen using the current pen / outlineColor

drawPixel
void drawPixel(Point where)

Drawing an individual pixel is slow. Avoid it if possible.

drawPixmap
void drawPixmap(Sprite s, Point upperLeft)
drawPolygon
void drawPolygon(Point[] vertexes)

.

drawRectangle
void drawRectangle(Point upperLeft, int width, int height)

Draws a rectangle using the current pen/outline color for the border and brush/fill color for the insides The outer lines, inclusive of x = 0, y = 0, x = width - 1, and y = height - 1 are drawn with the outlineColor The rest of the pixels are drawn with the fillColor. If fillColor is transparent, those pixels are not drawn.

drawRectangle
void drawRectangle(Point upperLeft, Point lowerRightInclusive)
Undocumented in source. Be warned that the author may not have intended to support it.
drawText
void drawText(Point upperLeft, char[] text, Point lowerRight, uint alignment)
drawText
void drawText(DrawableFont font, Point upperLeft, char[] text)

Draws text using a custom font.

drawText
void drawText(TextDrawingContext context, char[] text, uint alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
fontHeight
int fontHeight()
scrollArea
void scrollArea(Point upperLeft, int width, int height, int dx, int dy)

Scrolls the contents in the bounding rectangle by dx, dy. Positive dx means scroll left (make space available at the right), positive dy means scroll up (make space available at the bottom)

setClipRectangle
void setClipRectangle(Point pt, int width, int height)
void setClipRectangle(arsd.color.Rectangle rect)

Sets the clipping region for drawing. If width == 0 && height == 0, disabled clipping.

setFont
void setFont(OperatingSystemFont font)
textSize
Size textSize(char[] text)
updateDisplay
void updateDisplay()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

fillColor
Color fillColor [@property setter]
originX
int originX [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
originX
int originX [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
originY
int originY [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
originY
int originY [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
outlineColor
Color outlineColor [@property setter]
pen
Pen pen [@property setter]
rasterOp
RasterOp rasterOp [@property setter]

Structs

TextDrawingContext
struct TextDrawingContext
Undocumented in source.

Variables

currentClipRectangle
arsd.color.Rectangle currentClipRectangle;
Undocumented in source.
impl
ScreenPainterImplementation* impl;
Undocumented in source.
window
CapableOfBeingDrawnUpon window;
Undocumented in source.

Detailed Description

Most functions use the outlineColor instead of taking a color themselves. ScreenPainter is reference counted and draws its buffer to the screen when its final reference goes out of scope.

Meta