message: Rearranged `TextCached`, now has `.queue()` and `::draw_queued()`.
  Broke colors.
diff: @@ -28,32 +28,41 @@ impl TextCached {
  "`TextCached` can only be used with a `Font::GlyphFont`!".into(),
  ))
  }
  -}
  -impl Drawable for TextCached {
  - fn draw_ex(&self, ctx: &mut Context, param: DrawParam) -> GameResult<()> {
  - let color = match param.color {
  + /// Queues the `TextCached` to be drawn by `draw_queued()`.
  + /// This is much more efficient than using `graphics::draw()` or equivalent.
  + /// Note, any `TextCached` drawn via `graphics::draw()` will also draw the queue,
  + /// if it hasn't been drawn by `draw_queued()` yet.
  + pub fn queue(&self, context: &mut Context) {
  + /*let color = match param.color {
  Some(color) => color,
  None => get_color(ctx),
  - };
  + };*/
  let (font_id, font_scale) = (self.font_id, self.font_scale);
  - ctx.gfx_context.glyph_brush.queue(Section {
  + context.gfx_context.glyph_brush.queue(Section {
  text: &self.contents,
  //screen_position: (dest.x, dest.y),
  //bounds: (f32, f32),
  - scale: font_scale,
  - color: <[f32; 4]>::from(color),
  + scale: self.font_scale,
  + // color: <[f32; 4]>::from(color),
  //z: f32,
  //layout: Layout<BuiltInLineBreaker>,
  - font_id,
  + font_id: self.font_id,
  ..Section::default()
  });
  + }
  + /// Draws all of queued `TextCached`.
  + /// This is much more efficient than using `graphics::draw()` or equivalent.
  + pub fn draw_queued(context: &mut Context, param: DrawParam) -> GameResult<()> {
  type Mat4 = na::Matrix4<f32>;
  type Vec3 = na::Vector3<f32>;
  let (offset_x, offset_y) = (-1.0, 1.0);
  - let (screen_w, screen_h) = (ctx.gfx_context.screen_rect.w, ctx.gfx_context.screen_rect.h);
  + let (screen_w, screen_h) = (
  + context.gfx_context.screen_rect.w,
  + context.gfx_context.screen_rect.h,
  + );
  let (aspect, aspect_inv) = (screen_h / screen_w, screen_w / screen_h);
  let m_aspect = Mat4::new_nonuniform_scaling(&Vec3::new(1.0, aspect_inv, 1.0));
  let m_aspect_inv = Mat4::new_nonuniform_scaling(&Vec3::new(1.0, aspect, 1.0));
  @@ -89,18 +98,24 @@ impl Drawable for TextCached {
  * m_aspect_inv * m_offset_inv;
  let (encoder, render_tgt, depth_view) = (
  - &mut ctx.gfx_context.encoder,
  - &ctx.gfx_context.screen_render_target,
  - &ctx.gfx_context.depth_view,
  + &mut context.gfx_context.encoder,
  + &context.gfx_context.screen_render_target,
  + &context.gfx_context.depth_view,
  );
  - ctx.gfx_context.glyph_brush.draw_queued_with_transform(
  + Ok(context.gfx_context.glyph_brush.draw_queued_with_transform(
  m_transform.into(),
  encoder,
  render_tgt,
  depth_view,
  - )?;
  - Ok(())
  + )?)
  + }
  +}
  +
  +impl Drawable for TextCached {
  + fn draw_ex(&self, ctx: &mut Context, param: DrawParam) -> GameResult<()> {
  + self.queue(ctx);
  + TextCached::draw_queued(ctx, param)
  }
  fn set_blend_mode(&mut self, mode: Option<BlendMode>) {
  