Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="gameTime"></param>
        public void Update(GameTime gameTime)
        {
            spriteLayer.Clear();

            fps.Add(gameTime.Fps);
            while (fps.Count > 60)
            {
                fps.RemoveAt(0);
            }

            var vp = rs.DisplayBounds;

            spriteLayer.Draw(null, 0, 0, vp.Width, 44 + 8, new Color(64, 64, 64, 192));

            RText(0, Color.Orange, "FPS = {0,5:###.00} - {1,6:###.00} {2,6:###.00} {3,6:###.00}", gameTime.Fps, fps.Min(), fps.Average(), fps.Max());
            RText(1, Color.Orange, "RW Instances = {0}", rs.RenderWorld.Instances.Count);
            RText(2, Color.Orange, "Entities  = {0}", editor.World.entities.Count);
            RText(3, Color.Orange, "Map Nodes = {0}/{1}", editor.Selection.Count(), editor.Map.Nodes.Count);

            if (editor.EnableSimulation)
            {
                RText(4, Color.Red, "SIMULATION MODE");
            }
            else
            {
                RText(4, Color.Lime, "EDITOR MODE");
            }

            LText(0, Color.LightGray, "[F1] - Dashboard     [Q] - Select   ");
            LText(1, Color.LightGray, "[F2] - Save Map      [W] - Move     ");
            LText(2, Color.LightGray, "[F5] - Build Content [E] - Rotate   ");
            LText(3, Color.LightGray, "                     [R] - Scale    ");


            var mp = game.Mouse.Position;

            if (editor.manipulator.IsManipulating)
            {
                var text = editor.manipulator.ManipulationText;
                var len  = Math.Max(16, text.Length);
                spriteLayer.Draw(null, mp.X, mp.Y - 16 + 48, len * 8 + 16, 16, new Color(0, 0, 0, 128));
                spriteLayer.DrawDebugString(mp.X + 4, mp.Y - 12 + 48, editor.manipulator.ManipulationText, Color.Yellow);
            }

            //spriteLayer.Draw( null, editor.SelectionMarquee, new Color(51,153,255,128) );
            spriteLayer.Draw(null, editor.SelectionMarquee, new Color(82, 133, 166, 128));
        }
Exemple #2
0
 void DrawString(SpriteLayer layer, int x, int y, string text, Color color)
 {
                 #if USE_PROFONT
     consoleFont.DrawString(layer, text, x, y + consoleFont.BaseLine, color);
                 #else
     layer.DrawDebugString(x, y, text, color);
                 #endif
 }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        public override void Initialize()
        {
            testLayer = new SpriteLayer(GameEngine.GraphicsEngine, 1024);
            texture   = GameEngine.Content.Load <DiscTexture>("lena");
            debugFont = GameEngine.Content.Load <DiscTexture>("debugFont");

            testLayer.Clear();
            testLayer.Draw(texture, 10, 10 + 384, 256, 256, Color.White);

            testLayer.DrawDebugString(debugFont, 10, 276, "Lenna Soderberg", Color.White);

            GameEngine.GraphicsEngine.SpriteLayers.Add(testLayer);
        }