abstract struct Number
- Number
- Value
- Object
Overview
The top-level number type.
Included Modules
- Comparable(Number)
- Steppable
Defined in:
glint/number.crInstance Method Summary
-
#degrees
Returns a number as an angle, annotated as degrees.
-
#fps
Returns a number annotated as frames per second.
-
#pixels
Returns a number annotated as pixels.
-
#radians
Returns a number as an angle, annotated as radians.
-
#to_degrees
Returns an angle (assumed in radians) converted to degrees.
-
#to_radians
Returns an angle (assumed in degrees) converted to radians.
Instance Method Detail
def fps
#
Returns a number annotated as frames per second.
Negative values are not supported.
Example:
Game.target_framerate = 30.fps
def pixels
#
Returns a number annotated as pixels.
Example:
self.position.x += 24.pixels # Shift the x position of the game object by 24 pixels.