diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2022-02-02 19:08:44 +0100 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2022-02-02 19:08:44 +0100 |
commit | ceb3eff116f9ddf8dcb71a0a77efb63531f75ab2 (patch) | |
tree | c818ad7241797fa72e0cb802f09c9a1b296e1fb0 /src/dialogbox.rs | |
parent | 8cdbe7352c4846eb339358bcca6083f747e27721 (diff) |
Diffstat (limited to 'src/dialogbox.rs')
-rw-r--r-- | src/dialogbox.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/dialogbox.rs b/src/dialogbox.rs index 7e140ba..0fe2571 100644 --- a/src/dialogbox.rs +++ b/src/dialogbox.rs @@ -1,9 +1,9 @@ use ggez::conf::Conf; use ggez::graphics::{ - self, DrawMode, DrawParam, Font, Mesh, MeshBuilder, Rect, Scale, Text, TextFragment, + self, DrawMode, DrawParam, Font, Mesh, MeshBuilder, PxScale, Rect, Text, TextFragment, }; -use ggez::nalgebra::Point2; use ggez::{filesystem, Context, GameResult}; +use glam; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -59,6 +59,7 @@ impl DialogBox { ), constants::PURPLE, ) + .unwrap() .build(context) .unwrap(), conf, @@ -76,14 +77,14 @@ impl DialogBox { let text = Text::new( TextFragment::new(dialog.text.as_str()) .font(self.font) - .scale(Scale::uniform(40.0)), + .scale(PxScale::from(40.0)), ); graphics::draw(context, &self.mesh, DrawParam::default())?; graphics::draw( context, &text, - DrawParam::default().dest(Point2::new( + DrawParam::default().dest(glam::vec2( self.conf.window_mode.width * 0.11, 2.6 * self.conf.window_mode.height / 4.0, )), @@ -99,14 +100,14 @@ impl DialogBox { let text = Text::new( TextFragment::new(response.1.as_str()) .font(self.font) - .scale(Scale::uniform(40.0)), + .scale(PxScale::from(40.0)), ); graphics::draw( context, &text, DrawParam::default() - .dest(Point2::new( + .dest(glam::vec2( self.conf.window_mode.width * 0.11, (2.6 + (0.25 * (i + 1) as f32)) * self.conf.window_mode.height / 4.0, )) |