TestPixelWindow

introprog.examples.TestPixelWindow

Example of a simple PixelWindow app with an event loop that inspects key typing and mouse clicking by the user. See source code for inspiration on how to use PixelWindow for easy 2D game programming.

Attributes

Source
TestPixelWindow.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def main(args: Array[String]): Unit

Draw squares and start an event loop that prints events in terminal.

Draw squares and start an event loop that prints events in terminal.

Attributes

Source
TestPixelWindow.scala
def square(x: Int, y: Int, side: Int): Unit

Draw a square with (x, y) as top left corner and size side.

Draw a square with (x, y) as top left corner and size side.

Attributes

Source
TestPixelWindow.scala

Concrete fields

var color: Color

The color used by square.

The color used by square.

Attributes

Source
TestPixelWindow.scala
val w: PixelWindow

A reference to an instance of class PixelWindow.

A reference to an instance of class PixelWindow.

Attributes

Source
TestPixelWindow.scala