Ejemplo n.º 1
0
 /// <summary>
 /// Allows the game component to perform any initialization it needs to before starting
 /// to run.  This is where it can query for any required services and load content.
 /// </summary>
 public override void Initialize()
 {
     base.Initialize();
     // TODO: Add your initialization code here
     batch     = new PrimitiveBatch(GraphicsDevice);
     textBatch = new SpriteBatch(GraphicsDevice);
     font      = Game.Content.Load <SpriteFont>("DebugFont");
 }
        protected override void LoadContent()
        {
            vertexBatch = new PrimitiveBatch(Game.GraphicsDevice);
            edgeBatch   = new PrimitiveBatch(Game.GraphicsDevice);
            finishText  = new SpriteBatch(Game.GraphicsDevice);
            finishFont  = Game.Content.Load <SpriteFont>("DebugFont");

            base.LoadContent();
        }
Ejemplo n.º 3
0
 public void Draw(PrimitiveBatch batch)
 {
     batch.Begin(PrimitiveType.LineList);
     for (int i = 0; i < transformedVertices.Length; i++)
     {
         batch.AddVertex(transformedVertices[i], ShapeColor);
         batch.AddVertex(transformedVertices[
                             (i + 1) % transformedVertices.Length], ShapeColor);
     }
     batch.End();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Inititalises the static body
 /// </summary>
 protected void Init()
 {
     effect = new BasicEffect(graphics, null);
     // projection uses CreateOrthographicOffCenter to create 2d projection
     // matrix with 0,0 in the upper left.
     effect.Projection = Matrix.CreateOrthographicOffCenter
                             (0, graphics.Viewport.Width,
                             graphics.Viewport.Height, 0,
                             0, 1);
     effect.VertexColorEnabled = true;
     batch = new PrimitiveBatch(graphics);
 }