CoordinateSystem

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

There are 4 coordinate systems used by Kyd. As a game developer, you will almost always work in world coordinates. But it can be useful to understand when other coordinate systems are used, and how to convert between them.

The value of a Vector2 is meaningless without specifying which coordinate system it refers to. As an analogy, if you asked how hot it is outside, and I replied 30, that's meaningless. 30 Celsius, Fahrenheit, Kelvin? Converting between Celsius and Fahrenheit isn't as simple as multiplying by a constant, we need an addition AND a multiplication.

Converting between coordinate system is tricky, because it has to deal with scaling, translations as well as rotations. A Matrix is used to convert from one coordinate system to another.

When the coordinate system isn't specified, it is probably world coordinates. When a function (or class) uses more than 1 coordinate systems, it should specify the system as part of each variable name.

Entries

Link copied to clipboard

Measured in pixels, with (0,0) being at the top left of the window, the Y axis pointing downwards. This system is used for raw mouse events from the Glok GUI toolkit. If a class is derived from class Mode, then it is using these coordinates.

Link copied to clipboard

This is an intermediate step while converting from window to world coordinates. I use the word pin, because I imagine having two pieces of paper. One is marked out in world coordinate, and the other in window coordinates. I then put a pin through both pieces of paper. The pin is at StageView.worldPin and through StageView.viewPinRatio on the other piece of paper. They are now joined at a single point, but still free to rotate. If you change one piece of paper for rubber, you can also imagine scaling too.

Link copied to clipboard

By far the most commonly used coordinate system. Actor.position uses world coordinates. At the start of the game, (0,0) is probably at the center of the view, but if your games lets you scroll that will change.

Link copied to clipboard

Appearances (such as Pose and Graphic) use this system. (0,0) is wherever the pin is placed on the image.

Link copied to clipboard

An Actor can have child actors. The coordinates of the children are relative to the parent Actor.

Link copied to clipboard

I'm not sure if this really deserves to be called a coordinate system (because we never convert between it and any other system). However, I include it here for completeness.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.