/*
* HeadsUpDisplay.cs
* Authors: August Zinsser, Sriharsha Matta
*
* Copyright Matthew Belmonte 2007
*/
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Pina3D;
using Astropolis;
namespace tAC_Engine
{
///
/// A very simple class for drawing a static image, designed to be used by HUD elements. Game objects should use Entity instead of this struct.
///
public class StaticSprite
{
public Rectangle Location;
public float ZDepth;
public Texture2D Texture;
public Color Tint;
///
/// Initializer
///
///
///
///
public StaticSprite(Rectangle location, float zDepth, Texture2D texture)
{
Location = location;
ZDepth = zDepth;
Texture = texture;
Tint = Color.White;
}
///
/// Draw to the given spritebatch
///
///
public void Draw(SpriteBatch spriteBatch)
{
spriteBatch.Draw(
Texture,
Location,
null,
Tint,
0f,
new Vector2((float)Texture.Width / 2f, (float)Texture.Height / 2f),
SpriteEffects.None,
ZDepth);
}
}
///
/// Holds any combination of Texture2D's, ColladaModels, and Widgets and renders them to a spritebatch.
/// Both the 2D and 3D layers' origins are in the upper left corner of the screen, with +x to the right
/// and +y down as per standard screen coordinates.
/// The z-depth of the Texture2D's and the Z axis of the 3D scene interprets +z as away from the viewer
/// with z=0 lying on the plane of the physical display.
/// There is also an optional transparency layer, as well as support for special effect maps on the 3D objects
/// like normal, glow, reflection, etc.
///
public static class HUD
{
static SpriteBatch mSpriteBatchAlpha; // Render to a self-contained spritebatch
static SpriteBatch mSpriteBatchOpaque; // ''
static Texture2D mMousePointer; // The image for the mouse pointer
static bool mShowMousePointer = true; // If the mousepointer is visible or not, mostly set by games
static bool mForceHideMousePointer = false; // Trumps the showMousePointer variable
static List mSprites; // A list of sprites to draw
static List mModels; // '' models
static List mWidget2Ds; // '' widgets
static List mWidget3Ds; // '' widgets
static List