From 6a322b552583e75f8dc5b08ca1e1983c0e90af5b Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sun, 31 Jan 2021 06:12:43 -0600 Subject: starting gem --- src/main.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index d295f3a..4e18421 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,15 +2,20 @@ use ggez; use ggez::event; use ggez::graphics; use ggez::nalgebra as na; +use ggez::graphics::{self, spritebatch::SpriteBatch, DrawParam, FilterMode, Image, WrapMode}; -struct MainState { - pos_x: f32, +struct Game { + spritebatch: SpriteBatch, } impl MainState { - fn new() -> ggez::GameResult { - let s = MainState { pos_x: 0.0 }; - Ok(s) + fn new() -> ggez::GameResult { + let mut image = Image::new(context, "/gem.png")?; + image.set_filter(FilterMode::Nearest); + image.set_wrap(WrapMode::Mirror, WrapMode::Mirror); + + + Ok(MainState { spritebatch: SpriteBatch::new(image) }) } } -- cgit v1.2.3