setColor
setColor: (Graphics, Color?) -> ()Sets the colour (and the paint) for the draws that follow; nil is ignored.
| Method | Returns | Description |
|---|---|---|
setColor(Color?) | () | Sets the colour (and the paint) for the draws that follow; nil is ignored. |
getColor() | Color | The current colour (the last setColor, or the colour of the last colour paint). |
setFont(Font?) | () | Sets the font; nil is ignored. |
getFont() | Font | The current font. |
getFontMetrics() | FontMetrics | (Graphics) -> FontMetrics: The metrics of the current font, under the current text antialiasing. |
getFontMetrics(Font) | FontMetrics | |
clipRect(number, number, number, number) | () | Intersects the clip with a rectangle. |
setClip(Shape?) | () | (Graphics, Shape?) -> (): Replaces the clip with shape; nil removes it. |
setClip(number, number, number, number) | () | |
getClip() | Shape? | The clip in user space, or nil with none. |
getClipBounds() | Rectangle? | The clip's bounds in user space, or nil with none. |
hitClip(number, number, number, number) | boolean | Whether a rectangle might intersect the clip (a bounds test). |
create() | Graphics2D | (Graphics) -> Graphics2D: A new graphics object with a copy of this one's state. |
create(number, number, number, number) | Graphics2D | |
dispose() | () | Releases a graphics object create made; later calls on it draw nothing. The graphics render is handed is never released. |
drawLine(number, number, number, number) | () | A line (Bresenham without antialiasing). |
drawRect(number, number, number, number) | () | A rectangle's outline: columns x..=x+w, rows y..=y+h. |
fillRect(number, number, number, number) | () | A filled rectangle. |
clearRect(number, number, number, number) | () | Fills a rectangle with the background colour. |
drawOval(number, number, number, number) | () | An oval's outline in the rectangle. |
fillOval(number, number, number, number) | () | A filled oval in the rectangle. |
drawRoundRect(number, number, number, number, number, number) | () | A rounded rectangle's outline. |
fillRoundRect(number, number, number, number, number, number) | () | A filled rounded rectangle. |
drawArc(number, number, number, number, number, number) | () | An open arc's outline (angles in degrees, counter-clockwise from 3 o'clock). |
fillArc(number, number, number, number, number, number) | () | A filled pie arc. |
drawPolygon(Polygon) | () | (Graphics, Polygon) -> (): A closed polygon's outline. |
drawPolygon({number}, {number}, number) | () | |
fillPolygon(Polygon) | () | (Graphics, Polygon) -> (): A filled polygon (even-odd). |
fillPolygon({number}, {number}, number) | () | |
drawPolyline({number}, {number}, number) | () | An open polyline from the first n points. |
setColorsetColor: (Graphics, Color?) -> ()Sets the colour (and the paint) for the draws that follow; nil is ignored.
getColorgetColor: (Graphics) -> ColorThe current colour (the last setColor, or the colour of the last colour paint).
setFontsetFont: (Graphics, Font?) -> ()Sets the font; nil is ignored.
getFontgetFont: (Graphics) -> FontThe current font.
getFontMetricsgetFontMetrics: ((Graphics) -> FontMetrics) & ((Graphics, Font) -> FontMetrics)(Graphics) -> FontMetrics: The metrics of the current font, under the current text antialiasing.
(Graphics, Font) -> FontMetrics: The metrics of font, under the current text antialiasing.
clipRectclipRect: (Graphics, number, number, number, number) -> ()Intersects the clip with a rectangle.
setClipsetClip: ((Graphics, Shape?) -> ()) & ((Graphics, number, number, number, number) -> ())(Graphics, Shape?) -> (): Replaces the clip with shape; nil removes it.
(Graphics, number, number, number, number) -> (): Replaces the clip with a rectangle.
getClipgetClip: (Graphics) -> Shape?The clip in user space, or nil with none.
getClipBoundsgetClipBounds: (Graphics) -> Rectangle?The clip's bounds in user space, or nil with none.
hitCliphitClip: (Graphics, number, number, number, number) -> booleanWhether a rectangle might intersect the clip (a bounds test).
createcreate: ((Graphics) -> Graphics2D) & ((Graphics, number, number, number, number) -> Graphics2D)(Graphics) -> Graphics2D: A new graphics object with a copy of this one's state.
(Graphics, number, number, number, number) -> Graphics2D: A new graphics object translated to (x, y) and clipped to (0, 0, w, h).
disposedispose: (Graphics) -> ()Releases a graphics object create made; later calls on it draw nothing. The graphics render is handed is never released.
drawLinedrawLine: (Graphics, number, number, number, number) -> ()A line (Bresenham without antialiasing).
drawRectdrawRect: (Graphics, number, number, number, number) -> ()A rectangle's outline: columns x..=x+w, rows y..=y+h.
fillRectfillRect: (Graphics, number, number, number, number) -> ()A filled rectangle.
clearRectclearRect: (Graphics, number, number, number, number) -> ()Fills a rectangle with the background colour.
drawOvaldrawOval: (Graphics, number, number, number, number) -> ()An oval's outline in the rectangle.
fillOvalfillOval: (Graphics, number, number, number, number) -> ()A filled oval in the rectangle.
drawRoundRectdrawRoundRect: (Graphics, number, number, number, number, number, number) -> ()A rounded rectangle's outline.
fillRoundRectfillRoundRect: (Graphics, number, number, number, number, number, number) -> ()A filled rounded rectangle.
drawArcdrawArc: (Graphics, number, number, number, number, number, number) -> ()An open arc's outline (angles in degrees, counter-clockwise from 3 o'clock).
fillArcfillArc: (Graphics, number, number, number, number, number, number) -> ()A filled pie arc.
drawPolygondrawPolygon: ((Graphics, Polygon) -> ()) & ((Graphics, {number}, {number}, number) -> ())(Graphics, Polygon) -> (): A closed polygon's outline.
(Graphics, {number}, {number}, number) -> (): A closed polygon's outline from the first n points of the two arrays.
fillPolygonfillPolygon: ((Graphics, Polygon) -> ()) & ((Graphics, {number}, {number}, number) -> ())(Graphics, Polygon) -> (): A filled polygon (even-odd).
(Graphics, {number}, {number}, number) -> (): A filled polygon from the first n points (even-odd).
drawPolylinedrawPolyline: (Graphics, {number}, {number}, number) -> ()An open polyline from the first n points.