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
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.
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.
Properties
Functions
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.)
Returns an array containing the constants of this enum type, in the order they're declared.