Package-level declarations

Types

Link copied to clipboard

A polygon that is drawn the way a pen would draw it: the outline is drawn round from a corner, and when it has gone all the way round the fill comes in (fades in). What the screen shows at a moment of the effect.

Link copied to clipboard
class DrawOutlineEffect(repository: EntityRepository, polygon: DrawnPolygon, spec: AnimationSpec, options: DrawOutlineOptions = DrawOutlineOptions(), onFinished: () -> Unit = {}) : Animatable

Plays DrawOutline on the polygon with the id of polygon in repository: register it with the host's AnimationController and every tick puts in the repository what DrawOutline.at gives for how far along it is, in the place of the polygon (the other shapes stay as they are). When it is over, the repository holds polygon again and onFinished is called; one that has finished does nothing more, so the host can unregister it there.

Link copied to clipboard
data class DrawOutlineOptions(val drawShare: Float = 0.7f, val startAt: VertexId? = null, val reversed: Boolean = false, val lineColor: ColorRgba? = null, val lineWidth: Float? = null, val penColor: ColorRgba = ColorRgba(0, 0, 0), val headColor: ColorRgba? = null, val trailShare: Float = 0.25f, val trailBands: Int = 10, val glow: Float = 1.0f)

How a polygon's outline is drawn by DrawOutline.

Link copied to clipboard
object Morph

The drawing at a moment between two Snapshots: what a transition shows while it plays.

Link copied to clipboard
class RouteEffect(repository: EntityRepository, id: EntityId, route: List<GeoPosition>, spec: AnimationSpec, options: RouteOptions = RouteOptions(), onFinished: () -> Unit = {}) : Animatable

Plays RouteMotion on route in repository: register it with the host's AnimationController and every tick puts in the repository, besides the shapes that are already there, what RouteMotion.at gives for how far along the trip is. When it is over, the repository holds what the trip leaves (RouteOptions.keepTrail, RouteOptions.keepVehicle) and onFinished is called; one that has finished does nothing more, so the host can unregister it there.

Link copied to clipboard

A vehicle (a plane, a car, a ship) going along a route, and the line it leaves behind: what the screen shows at a moment of the trip.

Link copied to clipboard
data class RouteOptions(val lineColor: ColorRgba = ColorRgba(255, 60, 20), val headColor: ColorRgba? = null, val lineWidth: Float = 3.0f, val trailShare: Float = 0.3f, val trailBands: Int = 10, val glow: Float = 1.5f, val vehicle: ShapeStyle? = null, val vehicleSize: Float = 32.0f, val vehicleTurn: Float = 0.0f, val height: Float = 0.15f, val arc: Float = 0.0f, val arcSteps: Int = 32, val lift: Float = 0.0f, val shadow: ShapeStyle? = null, val keepTrail: Boolean = true, val keepVehicle: Boolean = false, val zIndex: Int = 100)

How a vehicle's trip along a route looks, for RouteMotion.

Link copied to clipboard
data class Snapshot(val entities: List<DrawableEntity>)

The drawing at one moment: every shape, in drawing order. The shapes are immutable, so a snapshot is not a copy of anything, it is the list itself, and holding one costs nothing. To keep one beyond the run of the app, write it with the serialization module (DrawJson).

Link copied to clipboard
class SnapshotTransition(repository: EntityRepository, from: Snapshot, to: Snapshot, spec: AnimationSpec, onFinished: () -> Unit = {}) : Animatable

Plays the drawing in repository from the snapshot from to to: register it with the host's AnimationController and every tick sets the shapes to what Morph gives for how far along it is (the curve of spec decides how that moves). When it is over, repository holds exactly to and onFinished is called; a transition that has finished does nothing more, so the host can unregister it there.

Functions

Link copied to clipboard

Puts the drawing back as snapshot has it, in one change. This is not an edit: nothing is added to the undo history, and the shapes the drawing had before are gone (take a snapshot first to keep them).

Link copied to clipboard

The drawing as it is now.