From: Alexis Laferrière Date: Tue, 29 Sep 2015 20:49:40 +0000 (-0400) Subject: lib/gamnit: intro `GamnitDisplay::aspect_ratio` X-Git-Tag: v0.8~41^2~5 X-Git-Url: http://nitlanguage.org lib/gamnit: intro `GamnitDisplay::aspect_ratio` Signed-off-by: Alexis Laferrière --- diff --git a/lib/gamnit/display.nit b/lib/gamnit/display.nit index 94ece8a..97d82b5 100644 --- a/lib/gamnit/display.nit +++ b/lib/gamnit/display.nit @@ -32,6 +32,9 @@ class GamnitDisplay # Height of the display, in pixels fun height: Int is abstract + # Aspect ratio of the screen, `width / height` + var aspect_ratio: Float is lazy do return width.to_f / height.to_f + # Prepare this display # # The implementation varies per platform.