summaryrefslogtreecommitdiff
path: root/src/dialogbox.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogbox.rs')
-rw-r--r--src/dialogbox.rs13
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,
))