From 07eb2dc0cbeaa7eb64645a86bd11842717a107a6 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Fri, 19 Mar 2021 19:49:08 +0100 Subject: added background --- src/game.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/game.rs') diff --git a/src/game.rs b/src/game.rs index 5b72d9d..d2b88e8 100644 --- a/src/game.rs +++ b/src/game.rs @@ -1,7 +1,7 @@ use ggez::event::EventHandler; use ggez::graphics::{self, spritebatch::SpriteBatch, DrawParam, FilterMode, Image, WrapMode}; use ggez::input::mouse; -use ggez::mint::Point2; +use ggez::mint::{Point2, Vector2}; use ggez::{Context, GameResult}; use std::time::Instant; @@ -252,7 +252,11 @@ impl EventHandler for Game { fn draw(&mut self, context: &mut Context) -> GameResult { graphics::clear(context, [0.0, 0.0, 0.0, 1.0].into()); - graphics::draw(context, &self.background, DrawParam::default())?; + graphics::draw( + context, + &self.background, + DrawParam::default().scale(Vector2 { x: 3.35, y: 3.35 }), + )?; self.cosmonaut.draw(context)?; for row in self.grid.iter() { -- cgit v1.2.3