From ceb3eff116f9ddf8dcb71a0a77efb63531f75ab2 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Wed, 2 Feb 2022 19:08:44 +0100 Subject: 2022 update --- src/dialogbox.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/dialogbox.rs') 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, )) -- cgit v1.2.3