From e2d2f011c6373894b3cdcfbdb98fbc783504561a Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 3 Aug 2019 20:26:07 -0400 Subject: 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. --- src/types/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/types/mod.rs') diff --git a/src/types/mod.rs b/src/types/mod.rs index 31d2ecd297..d417e873d8 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 { -- cgit 1.4.1