o1.world.objects

Type members

Classlikes

trait Anchor

An Anchor is a point where a two-dimensional object, such as a Pic, attaches to other such objects; you can also think of it as a “pin” that attaches a Pic to a background.

An Anchor is a point where a two-dimensional object, such as a Pic, attaches to other such objects; you can also think of it as a “pin” that attaches a Pic to a background.

For instance, a Pic may have its Anchor at its center; the Pic may then be attached to a larger image at that image’s TopLeft (another anchor), so that the center of the first Pic is located at the top left-hand corner of the second Pic.

The companion object of this class provides several standard Anchors and a class Anchor.Absolute for creating new ones.

Anchor objects are immutable.

This trait has an alias in the top-level package o1, so it’s accessible to students simply via import o1.*.

See also:
Companion:
object
object Anchor

This companion object of class Anchor contains a number of standard anchors (TopLeft, Center, etc.) and a class for creating anchors in a custom location.

This companion object of class Anchor contains a number of standard anchors (TopLeft, Center, etc.) and a class for creating anchors in a custom location.

The object has an alias in the top-level package o1, so it’s accessible to students simply via import o1.*.

See also:
Companion:
class
trait HasAnchor extends HasSize

A supertype for objects that have an anchoring point.

A supertype for objects that have an anchoring point.

trait HasContainer extends HasEdges

A supertype for objects that take up a rectangular area and whose position may be constrained by a larger object around them.

A supertype for objects that take up a rectangular area and whose position may be constrained by a larger object around them.

trait HasEdges extends HasPos with HasAnchor

A supertype for objects that take up a rectangular area and have an anchoring point. The object’s pos indicates the position of the anchoring point; the locations of its edges are determined relative to the anchor.

A supertype for objects that take up a rectangular area and have an anchoring point. The object’s pos indicates the position of the anchoring point; the locations of its edges are determined relative to the anchor.

trait HasPos

A supertype for objects that have a location in two-dimensional space.

A supertype for objects that have a location in two-dimensional space.

trait HasSize

A supertype for objects that have a size: a width and a height.

A supertype for objects that have a size: a width and a height.

trait HasVelocity extends HasPos

A supertype for objects that have a position and a velocity in two-dimensional space.

A supertype for objects that have a position and a velocity in two-dimensional space.

object mutable

This subpackage defines a few additional traits that extend the ones in of o1.world.objects. These traits provide additional convenience methods for working with mutable objects in two-dimensional space.

This subpackage defines a few additional traits that extend the ones in of o1.world.objects. These traits provide additional convenience methods for working with mutable objects in two-dimensional space.

NOTE TO STUDENTS: In this course, you don’t need to understand how this package works or can be used. That being said, some students may wish to experiment with some of its contents. Several of the traits in this package have aliases in the top-level package o1, so they are accessible to students simply via import o1.*.