about summary refs log tree commit diff
path: root/src/types/mod.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-08-04T00·26-0400
committerGriffin Smith <root@gws.fyi>2019-08-04T00·31-0400
commite2d2f011c6373894b3cdcfbdb98fbc783504561a (patch)
treea10ab475547d5496484c1ca89a079b32ca90706f /src/types/mod.rs
parent48fb3f6624b95e9b18a5ff0a814573445c6bc2ab (diff)
Add method for writing option menus to viewport
Add a method for writing single-choice menus to the viewport, within a
box. Unused for now.
Diffstat (limited to 'src/types/mod.rs')
-rw-r--r--src/types/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/types/mod.rs b/src/types/mod.rs
index 31d2ecd29770..d417e873d8ca 100644
--- a/src/types/mod.rs
+++ b/src/types/mod.rs
@@ -5,10 +5,13 @@ use std::cmp::max;
 use std::cmp::Ordering;
 use std::ops;
 use std::rc::Rc;
+
 pub mod collision;
 pub mod command;
 pub mod direction;
 pub mod entity_map;
+pub mod menu;
+
 pub use collision::Collision;
 pub use direction::Direction;
 pub use direction::Direction::*;
@@ -78,6 +81,14 @@ impl BoundingBox {
             })
     }
 
+    pub fn ll_corner(self) -> Position {
+        self.position
+            + (Position {
+                x: 0,
+                y: self.dimensions.h as i16,
+            })
+    }
+
     /// Returns a bounding box representing the *inside* of this box if it was
     /// drawn on the screen.
     pub fn inner(self) -> BoundingBox {