message: Add spritebatch to the colorspace example
diff: @@ -82,6 +82,7 @@ struct MainState {
  square_mesh: graphics::Mesh,
  demo_image: graphics::Image,
  demo_text: graphics::Text,
  + demo_spritebatch: graphics::spritebatch::SpriteBatch,
  }
  impl MainState {
  @@ -107,12 +108,14 @@ impl MainState {
  font: Some(graphics::Font::default()),
  scale: Some(graphics::Scale::uniform(300.0)),
  });
  + let demo_spritebatch = graphics::spritebatch::SpriteBatch::new(demo_image.clone());
  let s = MainState {
  demo_mesh,
  square_mesh,
  demo_image,
  demo_text,
  + demo_spritebatch
  };
  Ok(s)
  }
  @@ -136,24 +139,46 @@ impl event::EventHandler for MainState {
  // Draw things partially over the white square so we can see
  // where they are; they SHOULD be the same color as the
  // background.
  +
  + // mesh
  graphics::draw(
  ctx,
  &self.demo_mesh,
  DrawParam::default().dest(na::Point2::new(150.0, 200.0)),
  )?;
  + // image
  graphics::draw(
  ctx,
  &self.demo_image,
  DrawParam::default().dest(na::Point2::new(450.0, 200.0)),
  )?;
  + // text
  graphics::draw(
  ctx,
  &self.demo_text,
  DrawParam::default().dest(na::Point2::new(150.0, 135.0)),
  )?;
  + // spritebatch
  + self.demo_spritebatch.add(
  + DrawParam::default()
  + .dest(na::Point2::new(250.0, 350.0))
  + .scale(na::Vector2::new(0.25, 0.25))
  + );
  + self.demo_spritebatch.add(
  + DrawParam::default()
  + .dest(na::Point2::new(250.0, 425.0))
  + .scale(na::Vector2::new(0.1, 0.1))
  + );
  + graphics::draw(
  + ctx,
  + &self.demo_spritebatch,
  + DrawParam::default().dest(na::Point2::new(0.0, 0.0)),
  + )?;
  + self.demo_spritebatch.clear();
  +
  graphics::present(ctx)?;
  Ok(())
  }
  