A window with a canvas for pixel-based drawing.
- Value Params
- background
the color used when clearing pixels
- foreground
the foreground color, default color in drawing operations
- height
number of vertical pixels
- title
the title of the window
- width
the number of horizontal pixels
- Constructor
Create a new window for pixel-based drawing.
- Companion
- object
- Source
- PixelWindow.scala
Value members
Concrete methods
Wait for next event until timeoutInMillis
milliseconds.
Wait for next event until timeoutInMillis
milliseconds.
If time is out, lastEventType
is Undefined
.
- Source
- PixelWindow.scala
Clear all pixels using the background
class parameter.
Clear all pixels using the background
class parameter.
- Source
- PixelWindow.scala
Clear the pixel at (x, y)
using the background
class parameter.
Clear the pixel at (x, y)
using the background
class parameter.
If (x, y) is outside of window bounds then an IllegalArgumentException is thrown.
- Source
- PixelWindow.scala
Draw img
at (x, y)
scaled to (width, height)
and rotated (angle)
radians clockwise.
Draw img
at (x, y)
scaled to (width, height)
and rotated (angle)
radians clockwise.
If angle is 0 then no rotation is applied.
- Source
- PixelWindow.scala
Draw text
at (x, y)
using color
, size
, style and
fontName`.
Draw text
at (x, y)
using color
, size
, style and
fontName`.
- Source
- PixelWindow.scala
Fill a rectangle with upper left corner at (x, y)
using color
.
Fill a rectangle with upper left corner at (x, y)
using color
.
- Source
- PixelWindow.scala
Return image of PixelWindow section defined by top left corner (x, y)
and (width, height)
.
Return image of PixelWindow section defined by top left corner (x, y)
and (width, height)
.
- Source
- PixelWindow.scala
Return the color of the pixel at (x, y)
.
Return the color of the pixel at (x, y)
.
If (x, y) is outside of window bounds then an IllegalArgumentException is thrown.
- Source
- PixelWindow.scala
Hide the window. Has no effect if the window is already hidden.
Hide the window. Has no effect if the window is already hidden.
- Source
- PixelWindow.scala
Return true
if (x, y)
is inside windows borders else false
.
Return true
if (x, y)
is inside windows borders else false
.
- Source
- PixelWindow.scala
The event type of the latest event in the event queue.
The event type of the latest event in the event queue.
Returns Event.Undefined if no event has occurred. See also introprog.PixelWindow.awaitEvent
- Source
- PixelWindow.scala
A string representing the last key pressed.
A string representing the last key pressed.
Returns an empty string if no key event has occurred.
- Source
- PixelWindow.scala
A pair of integers with the coordinates of the last mouse event.
A pair of integers with the coordinates of the last mouse event.
Returns (-1, -1)
if no mouse event has occurred.
- Source
- PixelWindow.scala
Draw a line from (x1
, y1
) to (x2
, y2
) using color
and lineWidth
.
Draw a line from (x1
, y1
) to (x2
, y2
) using color
and lineWidth
.
- Source
- PixelWindow.scala
Set the color of the pixel at (x, y)
.
Set the color of the pixel at (x, y)
.
If (x, y) is outside of window bounds then an IllegalArgumentException is thrown.
- Source
- PixelWindow.scala
Show the window. Has no effect if the window is already visible.
Show the window. Has no effect if the window is already visible.
- Source
- PixelWindow.scala