Beispiel #1
0
        public static void Render()
        {
            if (baseCamera != null)
            {
                device.Clear(Color.Red);

                GraphicsComponent.RenderState state = new GraphicsComponent.RenderState();
                state.spriteBatch = spriteBatch;

                baseCamera.Render(state);

                device.SetRenderTarget(null);
                spriteBatch.Begin();
                spriteBatch.Draw(baseCamera.backbuffer, new Rectangle(0, 0, resolution.X, resolution.Y), Color.White);
                spriteBatch.End();
                spriteBatch.Begin();
                spriteBatch.DrawString(defaultFont,"" + UpdateManager.CycleCount,Vector2.Zero, Color.LightBlue);
                //spriteBatch.DrawString(defaultFont,"" + Statistics.updatesPerSec,Vector2.Zero, Color.Red);
                //spriteBatch.DrawString(defaultFont, "" + Statistics.fps, Vector2.UnitY * 50f, Color.Red);
                //spriteBatch.DrawString(defaultFont, "" + Statistics.keyPresses, Vector2.UnitY * 100f, Color.Red);
                spriteBatch.End();
            }
        }
Beispiel #2
0
        public static void Render()
        {
            if (baseCamera != null)
            {
                device.Clear(Color.Red);

                GraphicsComponent.RenderState state = new GraphicsComponent.RenderState();
                state.spriteBatch = spriteBatch;

                baseCamera.Render(state);

                device.SetRenderTarget(null);
                spriteBatch.Begin();
                spriteBatch.Draw(baseCamera.backbuffer, new Rectangle(0, 0, resolution.X, resolution.Y), Color.White);
                spriteBatch.End();
                spriteBatch.Begin();
                spriteBatch.DrawString(defaultFont, "" + UpdateManager.CycleCount, Vector2.Zero, Color.LightBlue);
                //spriteBatch.DrawString(defaultFont,"" + Statistics.updatesPerSec,Vector2.Zero, Color.Red);
                //spriteBatch.DrawString(defaultFont, "" + Statistics.fps, Vector2.UnitY * 50f, Color.Red);
                //spriteBatch.DrawString(defaultFont, "" + Statistics.keyPresses, Vector2.UnitY * 100f, Color.Red);
                spriteBatch.End();
            }
        }
Beispiel #3
0
 internal override void Render(GraphicsComponent.RenderState state)
 {
     state.spriteBatch.DrawString(font.font, text, position, filter, rotation, font.font.MeasureString(text) / 2f, scale, SpriteEffects.None, layer);
 }
Beispiel #4
0
 internal override void Render(GraphicsComponent.RenderState state)
 {
     state.spriteBatch.Draw(texture.texture, position, null, filter, rotation, texture.center, scale, SpriteEffects.None, layer);
 }
Beispiel #5
0
 internal abstract void Render(RenderState state);