Package-level declarations

Types

Link copied to clipboard

Commonality shared by Game, ActResource and all other ParentResource concrete types.

Link copied to clipboard

Commonality shared by Folder and other ParentResources.

Link copied to clipboard
class Act
Link copied to clipboard
class Actor(parent: ActorParent) : ActorParent

An Actor represents every item you see within the game, and is arguably the most important Kyd class,

Link copied to clipboard
interface ActorParent

An Actor's parent is either another Actor or a Stage.

Link copied to clipboard

An ActResource is part of the Game's Resource tree, whereas an Act is NOT a Resource and is therefore NOT in the Resource tree.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Defines how an Actor moves etc.

Link copied to clipboard

This class is NOT used, it is used for documentation only.

Link copied to clipboard
interface Customisable
Link copied to clipboard
expect class DateTime
actual class DateTime
actual class DateTime
Link copied to clipboard
Link copied to clipboard
interface Enumerable<T : Enum<T>>

Java's Enums are infuriating. If you have an instance of an Enum, there is no way to enumerate all possible values. Isn't that ironic given 'Enum' is short for enumeration. You need the Enum's type (at compile-time, which Kyd doesn't have)

Link copied to clipboard
Link copied to clipboard

A ParentResource which has no data of its own, but only acts as a parent for a group of children.

Link copied to clipboard
class Game(val filePath: String, val resources: Resources) : AbstractParentOrGame

The root node of a game's tree of resources. Each node in this tree implements the Resource interface.

Link copied to clipboard
class GridSnapping(val sizeX: Float, val sizeY: Float) : Snapping
Link copied to clipboard
object JarLoader
Link copied to clipboard
Link copied to clipboard
object Launcher
Link copied to clipboard

A reference to another resource (similar to symbolic links in *nix filesystems).

Link copied to clipboard
open class Management(val game: Game)

Management exists the entire time that the program is running, and is in charge of the boring nitty-gritty, such as loading Acts.

Link copied to clipboard

Many Behaviours are never interact with mouse presses, and if we checked every single Role when a mouse was pressed/released, this would be quite expensive (because to convert from screen coordinates to the Actor's local coordinates is non-trivial).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface ObservableVector2 : ObservableValue<Vector2>

Boilerplate which avoids having to use generics. Instead of ObservableValue<Vector2>, use ObservableVector2.

Link copied to clipboard
interface Overlapping

Checks if two actors overlap each other.

Link copied to clipboard
Link copied to clipboard
class Pick(name: String = "")

Picks appear in a side panel of the editor, and can be picked and dropped onto a Stage when editing an Act.

Link copied to clipboard
class PickGroup(name: String = "")
Link copied to clipboard
class PixelOverlapping(threshold: Float) : Overlapping

Checks that actors bounding rectangles overlap, and then checks if any pixels overlap. i.e. any non-transparent pixels of actorA are in the same place as any non-transparent pixels of actorB.

Link copied to clipboard
interface ReadOnlyVector2Property : ObservableVector2, ReadOnlyProperty<Vector2>

Boilerplate which avoids having to use generics. Instead of ReadOnlyProperty<Vector2>, use ReadOnlyVector2Property.

Link copied to clipboard
class ReadOnlyVector2PropertyWrapper(wraps: Vector2Property) : ReadOnlyPropertyWrapper<Vector2, Property<Vector2>> , ReadOnlyVector2Property

Never use this class directly. Use Vector2Property.asReadOnly to obtain a read-only version of a mutable Vector2Property.

Link copied to clipboard

A Resource which links to other Resources, such as Pose, which links to a Graphic. While loading resources, the Resource only knows the PATH to the linked Resource, not the Resource itself (because that may not be loaded yet). Once the entire file is loaded, resolveReferences is called.

Link copied to clipboard
interface Resource

A Game is the root of a tree structure, with each node of the tree being an Resource. All of a games resources are stored within this tree.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class SimpleVector2Property(initialValue: Vector2, bean: Any? = null, beanName: String? = null) : SimpleProperty<Vector2> , Vector2Property

Boilerplate which avoids having to use generics. Instead of SimpleProperty<Vector2>, we can use SimpleVector2Property.

Link copied to clipboard
Link copied to clipboard
interface Snapping
Link copied to clipboard
open class Stage(val name: String) : ActorParent
Link copied to clipboard
Link copied to clipboard
interface Ticks
Link copied to clipboard
interface Touching

When a mouse event needs to check if the mouse is "touching" an actor, how is "touching" defined.

Link copied to clipboard
class TouchingAnd(val a: Touching, val b: Touching) : Touching

Performs 2 Touching tests. If the second test is only carried out if the first test passes.

Link copied to clipboard
class TouchingChildren(val baseTest: Touching) : Touching

Touching test which also checks the actor's children.

Link copied to clipboard
class TouchingDescendants(val baseTest: Touching) : Touching

Checks if an actor or any of its descendant actors are touching the given point.

Link copied to clipboard
class TouchingPixel(val alphaThreshold: Float) : Touching

Returns true iff the pixel at the given point has a alpha value alphaThreshold.

Link copied to clipboard
open class ValidatedVector2Property(initialValue: Vector2, bean: Any? = null, beanName: String? = null, validation: (ValidatedProperty<Vector2>, Vector2, Vector2) -> Vector2) : ValidatedProperty<Vector2> , Vector2Property

Boilerplate which avoids having to use generics. Instead of ValidatedProperty<Vector2>, we can use ValidatedVector2Property.

Link copied to clipboard
class Vector2BinaryFunction<A, OA : ObservableValue<A>, B, OB : ObservableValue<B>>(argA: OA, argB: OB, lambda: (A, B) -> Vector2) : BinaryFunction<Vector2, A, OA, B, OB> , ObservableVector2

Boilerplate which avoids having to use generics. An ObservableVector2 which is calculated from 2 (binary) other ObservableValues.

Link copied to clipboard

Boilerplate which avoids having to use generics. Instead of Property<Vector2>, use Vector2Property.

Link copied to clipboard
class Vector2TernaryFunction<A, OA : ObservableValue<A>, B, OB : ObservableValue<B>, C, OC : ObservableValue<C>>(argA: OA, argB: OB, argC: OC, lambda: (A, B, C) -> Vector2) : TernaryFunction<Vector2, A, OA, B, OB, C, OC> , ObservableVector2

Boilerplate which avoids having to use generics. An ObservableVector2 which is calculated from 3 (ternary) other ObservableValues.

Link copied to clipboard
class Vector2UnaryFunction<A, OA : ObservableValue<A>>(argA: OA, lambda: (A) -> Vector2) : UnaryFunction<Vector2, A, OA> , ObservableVector2

Boilerplate which avoids having to use generics. An ObservableVector2 which is calculated from 1 (unary) other ObservableValue.

Link copied to clipboard
Link copied to clipboard
class ZOrderStage(val name: String) : Stage

A Stage which automatically orders the Actors by Actor.zOrder.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val Pi: Float = 3.1415927f
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val Tau: Float
Link copied to clipboard

Functions

Link copied to clipboard
fun absolutePath(path: String, relativeTo: Resource): String
Link copied to clipboard
expect fun findCustomisableProperties(obj: Customisable): List<Property<*>>
actual fun findCustomisableProperties(obj: Customisable): List<Property<*>>
actual fun findCustomisableProperties(obj: Customisable): List<Property<*>>

For JVM-only games, it is sufficient to add @Custom to properties. The default implementation of Customisable.customProperties calls this, which uses reflection to find each Property tagged with a Custom annotation.

Link copied to clipboard

Returns not only the Property, but the Custom attribute too, so that the editor can use Custom.about and Custom.isAct etc.

Link copied to clipboard
Link copied to clipboard
expect fun loadCode(game: Game)
actual fun loadCode(game: Game)
actual fun loadCode(game: Game)
Link copied to clipboard
Link copied to clipboard
fun pathName(path: String): String
Link copied to clipboard
Link copied to clipboard
fun pathParent(path: String): String?
Link copied to clipboard
Link copied to clipboard
fun validatedVector2Property(initialValue: Vector2, validation: (ValidatedProperty<Vector2>, Vector2, Vector2) -> Vector2): PropertyDelegate<Vector2, Vector2Property>

A Kotlin delegate to create a ValidatedVector2Property. Typical usage :

Link copied to clipboard
fun vector2Property(initialValue: Vector2): PropertyDelegate<Vector2, Vector2Property>

A Kotlin delegate to create a Vector2Property (the implementation will be a SimpleVector2Property. Typical usage :