summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files 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<MainState> {
- let s = MainState { pos_x: 0.0 };
- Ok(s)
+ fn new() -> ggez::GameResult<Game> {
+ 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) })
}
}