abstract class ScreenDriver extends AnyRef
Driver methods for screen graphics.
The drawing area will have the specified width and height and will be positioned at the given location (if possible).
It will have a coordinate system with the origin (0, 0)
in the lower-left
corner and the upper-right corner at (width-1, height-1)
. All operations
ensure clipping to that area, so that it is safe to use coordinates outside
of it.
Implementations have to provide the activeColor
variable and the draw...
and fill...
methods as well as getPixel
and setPixel
.
- Alphabetic
- By Inheritance
- ScreenDriver
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Abstract Value Members
-
abstract
val
activeColor: Color
color to be used for the next operations (except for those that use their own color)
-
abstract
def
close(): Unit
Closes the screen this driver is associated to.
Closes the screen this driver is associated to.
- Since
1.3.0
- Note
Might not have an effect if the underlying implementation does not support such an operation.
-
abstract
def
drawArc(p0: Pixel, width: Int, height: Int, startAngle: Int, arcAngle: Int): Unit
Draws an arc within a virtual rectangle.
Draws an arc within a virtual rectangle.
Angles are given in degrees, where 0 is the direction of the x axis and positive values count counter-clockwise while negative values count clockwise.
- p0
centre of the arc
- width
of the enclosing rectangle
- height
of the enclosing rectangle
- startAngle
start in degrees
- arcAngle
extent in degrees
drawArc(Pixel(10,10), 5, 5, 0, 360) draws a circle of diameter 5 around the centre (10,10)
Example: -
abstract
def
drawLine(p1: Pixel, p2: Pixel): Unit
Draws a line from
p1
top2
. -
abstract
def
drawPolyline(p: Seq[Pixel]): Unit
Draws a polygonal chain with vertices defined by the specified sequence.
Draws a polygonal chain with vertices defined by the specified sequence.
The chain is not closed by default. To achieve this, set the last vertex equal to the first.
-
abstract
def
drawRectangle(p1: Pixel, p2: Pixel): Unit
Draws a rectangle with diagonal opposite corners at
p1
andp2
. -
abstract
def
drawText(p0: Pixel, text: String): Unit
Draws a text with lower-left corner at
p0
.Draws a text with lower-left corner at
p0
.- text
null
does nothing
-
abstract
def
fillArc(p0: Pixel, width: Int, height: Int, startAngle: Int, arcAngle: Int): Unit
Fills an arc within a virtual rectangle.
Fills an arc within a virtual rectangle.
Angles are given in degrees, where 0 is the direction of the x axis and positive values count counter-clockwise while negative values count clockwise.
- p0
centre of the arc
- width
of the enclosing rectangle
- height
of the enclosing rectangle
- startAngle
start in degrees
- arcAngle
extent in degrees
fillArc(Pixel(10,10), 5, 5, 0, 360) fills a circle of diameter 5 around the centre (10,10)
Example: -
abstract
def
fillPolygon(p: Seq[Pixel]): Unit
Fills a polygonal area with vertices defined by the specified sequence.
Fills a polygonal area with vertices defined by the specified sequence.
There is no need to close the sequence of vertices.
-
abstract
def
fillRectangle(p1: Pixel, p2: Pixel): Unit
Fills a rectangle with diagonal opposite corners at
p1
andp2
. -
abstract
def
getPixel(p: Pixel): Color
Gets color of a pixel.
Gets color of a pixel.
- returns
the color of the pixel at
p
orColor(0, 0, 0)
if it is outside of the drawing area
-
abstract
def
setPixel(p: Pixel, color: Color): Unit
Sets pixel to color.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flipV(y: Int): Int
Helper function for systems with origin at upper-left corner.
Helper function for systems with origin at upper-left corner.
- y
original coordinate
- returns
vertical flipped coordinate
- Attributes
- protected
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- val height: Int
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val p0: Pixel
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val title: String
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- val width: Int