Represents a drawing surface for rendering shapes, images, and text. It encapsulates a BufferAdapter
to provide a high-level drawing API.
Value parameters
- owner
-
The
BufferAdapter
instance that thisDrawingSurface
operates on.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Clears the drawing surface using the specified color.
Clears the drawing surface using the specified color.
Value parameters
- color
-
The
Color
to clear with. - useSourceColorLiterally
-
If true, uses the source color without blending.
Attributes
Draws an arc on the surface.
Draws an arc on the surface.
Value parameters
- arcAngle
-
Arc angle.
- fillStyle
-
Optional fill style for the arc.
- height
-
Height of the arc.
- rotationAngleInDegrees
-
Rotation angle in degrees.
- startAngle
-
Starting angle.
- strokeStyle
-
Optional stroke style for the arc.
- width
-
Width of the arc.
- xOffsetToOrigin
-
Offset to the origin.
- xPositionOfCenter
-
X position of the center.
- yOffsetToOrigin
-
Offset to the origin.
- yPositionOfCenter
-
Y position of the center.
Attributes
Draws a bitmap image with specified position and opacity.
Draws a bitmap image with specified position and opacity.
Value parameters
- bitmap
-
The
BufferedImage
to draw. - opacity
-
The opacity for the image.
- x
-
The x position in pixels.
- y
-
The y position in pixels.
Attributes
- Returns
-
A boolean indicating success.
Draws a point on the surface.
Draws a point on the surface.
Value parameters
- color
-
Color of the point.
- x
-
X position of the point.
- xOffsetToOrigin
-
Offset to the origin.
- y
-
Y position of the point.
- yOffsetToOrigin
-
Offset to the origin.
Attributes
Draws a polygon on the surface.
Draws a polygon on the surface.
Value parameters
- fillStyle
-
Optional fill style for the polygon.
- numberOfCoordinatesToDraw
-
Number of coordinates to draw.
- strokeStyle
-
Optional stroke style for the polygon.
- xCoordinates
-
X coordinates of the polygon points.
- xOffsetToOrigin
-
Offset to the origin.
- xPosition
-
X position.
- yCoordinates
-
Y coordinates of the polygon points.
- yOffsetToOrigin
-
Offset to the origin.
- yPosition
-
Y position.
Attributes
Draws text on the drawing surface, optionally scaling to fit within specified dimensions.
Draws text on the drawing surface, optionally scaling to fit within specified dimensions.
Value parameters
- fillStyle
-
An optional fill style for the text.
- font
-
The font used to draw the text.
- height
-
The height within which the text should fit. Used only if
isScaled
is true. - isScaled
-
Indicates whether the text should be scaled to fit within the specified width and height.
- strokeStyle
-
An optional stroke style for the text.
- text
-
The text content to be drawn.
- width
-
The width within which the text should fit. Used only if
isScaled
is true. - x
-
The x-coordinate of the center point for the text's bounding box.
- xOffsetToOrigin
-
The horizontal offset from the origin to the point where the text drawing begins.
- y
-
The y-coordinate of the center point for the text's bounding box.
- yOffsetToOrigin
-
The vertical offset from the origin to the point where the text drawing begins.