- cropArea
Optional!Rectangle cropArea()
Getter for the current crop area, if one is set. Any shape drawn is cropped to fit this area on the canvas.
- cropArea
void cropArea(Rectangle area)
void cropArea(Optional!Rectangle area)
Set an area the shapes can be drawn in. Any shape drawn after this call will be cropped to fit the specified
rectangle on the canvas.
- dpi
Vector2 dpi()
Determines the screen's pixel density. A higher value will effectively scale up the interface, but keeping all
detail. The I/O system should trigger a resize when this changes.
- drawCircle
void drawCircle(Vector2 center, float radius, Color color)
- drawCircleImpl
void drawCircleImpl(Vector2 center, float radius, Color color)
- drawCircleOutline
void drawCircleOutline(Vector2 center, float radius, float width, Color color)
Draw the outline of a circle.
- drawCircleOutlineImpl
void drawCircleOutlineImpl(Vector2 center, float radius, float width, Color color)
Draw the outline of a circle.
- drawHintedImage
void drawHintedImage(DrawableImage image, Rectangle destination, Color tint)
Undocumented in source. Be warned that the author may not have intended to support it.
- drawHintedImage
void drawHintedImage(DrawableImage image, Vector2 destination, Color tint)
- drawHintedImageImpl
void drawHintedImageImpl(DrawableImage image, Rectangle destination, Color tint)
- drawImage
void drawImage(DrawableImage image, Rectangle destination, Color tint)
void drawImage(DrawableImage image, Vector2 destination, Color tint)
Draw an image on the canvas.
- drawImageImpl
void drawImageImpl(DrawableImage image, Rectangle destination, Color tint)
Draw an image on the canvas.
- drawLine
void drawLine(Vector2 start, Vector2 end, float width, Color color)
Draw a line between two points.
- drawLineImpl
void drawLineImpl(Vector2 start, Vector2 end, float width, Color color)
Draw a line between two points.
- drawRectangle
void drawRectangle(Rectangle rectangle, Color color)
- drawRectangleImpl
void drawRectangleImpl(Rectangle rectangle, Color color)
- drawRectangleOutline
void drawRectangleOutline(Rectangle rectangle, float width, Color color)
Draw an outline of a rectangle.
- drawTriangle
void drawTriangle(Vector2 a, Vector2 b, Vector2 c, Color color)
Draw a triangle, consisting of 3 vertices with counter-clockwise winding.
- drawTriangleImpl
void drawTriangleImpl(Vector2 a, Vector2 b, Vector2 c, Color color)
Draw a triangle, consisting of 3 vertices with counter-clockwise winding.
- drawTriangleOutline
void drawTriangleOutline(Vector2 a, Vector2 b, Vector2 c, float width, Color color)
Draw an outline of a triangle.
- fromDots
Vector2 fromDots(Vector2 dots)
Measure distance in pixels taken by a number of dots.
- intersectCrop
Optional!Rectangle intersectCrop(Rectangle rectangle)
Crop the area to fit. Unlike setting cropArea, this will not replace the old area, but create an intersection
between the new and old area.
- load
int load(Image image)
Prepare an image for drawing. For hardware accelerated backends, this may involve uploading the texture
to the GPU.
- resetCropArea
void resetCropArea()
If cropArea was called before, this will reset set area, disabling the effect.
- toDots
Vector2 toDots(Vector2 pixels)
Convert pixels to screen-dependent dots.
I/O interface for canvas drawing functionality.
The canvas should use a coordinate system where (0,0) is the top-left corner. Every increment of 1 is equivalent to the distance of 1/96th of an inch. Consequentially, (96, 96) is 1 inch down and 1 inch right from the top-left corner of the canvas.
The canvas should allow all inputs and never throw. If there's a defined boundary, the canvas should crop all geometry to fit.