public void Draw(PrimitiveDrawer pd, GraphicsDevice graphics) { vector.X = x; vector.Y = y; pd.DrawFilledRectangle(graphics, this, Color.Red); }
public override void Draw(SpriteBatch spriteBatch, PrimitiveDrawer pd, FontHandler fontHandler, GraphicsDevice graphicsDevice) { vector.X = x; vector.Y = y; if(true) { Vector2 measurement = fontHandler.GetSourceCodePro().MeasureString(" " + text + " "); width = (int)measurement.X; height = (int)measurement.Y; } if(selected) pd.DrawFilledRectangle(graphicsDevice, this, colorOne); else pd.DrawFilledRectangle(graphicsDevice, this, colorTwo); spriteBatch.DrawString(fontHandler.GetSourceCodePro(), " " + text + " ", vector + TetrisGameRunner.GetOffsetVector(), Color.White); spriteBatch.End(); spriteBatch.Begin(); }
public override void Draw(PrimitiveDrawer drawer, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphics, SpriteBatch batch, FontHandler font) { if(borderMode) { drawer.DrawCircle(graphics, GetVector(), GetWidth(), border); drawer.DrawCircle(graphics, GetVector(), GetWidth()-1, color); } else { drawer.DrawCircle(graphics, GetVector(), GetWidth(), color); } if(editing) { drawer.DrawFilledRectangle(graphics, point, Color.White); } }
public void Draw(GraphicsDevice graphicsDevice, SpriteBatch batch, PrimitiveDrawer drawer, FontHandler font) { foreach (LevelObject o in objects) { if (o is LightLevelCircle) continue; o.Draw(drawer, graphicsDevice, batch, font); } drawer.DrawFilledRectangle(graphicsDevice, (Rectangle)(new GameRectangle(0, 0, 2000, 1000)), new Color(0, 0, 0, 220), false); foreach (LevelObject o in objects) { if (o is LightLevelCircle) o.Draw(drawer, graphicsDevice, batch, font); } }
public override void Draw(PrimitiveDrawer drawer, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphics, SpriteBatch batch, FontHandler font) { if(!normal) graphics.BlendState = TetrisGameRunner.LightState(); for (int i = 0;i < 2;i++) { if(culled) drawer.DrawCulledCircle(graphics, GetVector(), GetWidth(), color, Color.Black, 60, new GameRectangle(320, 0, 1024 - 320, 768)); else { drawer.DrawCircle(graphics, GetVector(), GetWidth(), color, Color.Black, 60); } } graphics.BlendState = TetrisGameRunner.OriginalState(); if (editing) { drawer.DrawFilledRectangle(graphics, point, Color.White); } }
protected override void onTweak() { PrimitiveDrawer.DrawFilledRectangle(mei.start.tx, mei.start.ty, mei.current.tx, mei.current.ty, new PrimitiveDrawer.Callback(cbTweak), null); }
public void Draw(SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, GraphicsDevice graphics) { #region Draw the Background of the Interface widthOfMenu = modes[0].GetWidth() + modes[1].GetWidth() + modes[2].GetWidth(); primitiveDrawer.DrawFilledRectangle(graphics, new Rectangle(0, 0, widthOfMenu, height), background); DrawSuggestions(spriteBatch, primitiveDrawer, fontHandler, graphics); primitiveDrawer.DrawFilledRectangle(graphics, new Rectangle(widthOfMenu, 0, width - widthOfMenu, height), background2); primitiveDrawer.DrawFilledRectangle(graphics, new Rectangle(widthOfMenu, 0, width - widthOfMenu, modes[0].GetHeight()), background); #endregion #region Draw the Text in the Top Right Corner String str = safeFileName; if(classManager != null) { str = classManager.GetName(); } int wdt = (int)fontHandler.GetVerdana().MeasureString(str).X + 3; primitiveDrawer.DrawFilledRectangle(graphics, new Rectangle(width - wdt - 6, 0, wdt + 6, modes[0].GetHeight()), new Color(0x29, 0x80, 0xb9)); spriteBatch.DrawString(fontHandler.GetVerdana(), str, new Vector2(width - wdt, 6) + TetrisGameRunner.GetOffsetVector(), Color.White); #endregion #region Set the Position of the Scroll Buttons scrollDown.SetY(height - scrollDown.GetHeight()); scrollUp.SetY(height - scrollUp.GetHeight()); scrollDown.SetWidth(widthOfMenu / 2 - 2); scrollDown.SetX(1); scrollUp.SetWidth(widthOfMenu / 2 - 2); scrollUp.SetX(widthOfMenu / 2 + 1); #endregion #region Set the Position of the Mode Buttons modes[1].SetX(modes[0].GetWidth()); modes[2].SetX(modes[0].GetWidth() + modes[1].GetWidth()); #endregion #region Draw the Elements and Modes and Such DrawModes(spriteBatch, primitiveDrawer, fontHandler, graphics); DrawElements(spriteBatch, primitiveDrawer, fontHandler, graphics); #endregion #region Draw the Scroll Buttons scrollDown.Draw(spriteBatch, primitiveDrawer, fontHandler, graphics); scrollUp.Draw(spriteBatch, primitiveDrawer, fontHandler, graphics); #endregion }
public void Draw(GraphicsDevice graphicsDevice, SpriteBatch batch, PrimitiveDrawer drawer, FontHandler font) { if(animationMode) { tool.Draw(graphicsDevice, batch, drawer, font); return; } //batch.DrawString(font.GetLucidaSansTypewriter(), "Hey" + (couldDrag == null), new Vector2(0, 100), Color.Red); foreach (LevelObject o in objects) { if (o is LightLevelCircle) continue; o.Draw(drawer, graphicsDevice, batch, font); } if (colorize != null) { drawer.DrawFilledRectangle(graphicsDevice, new Rectangle(originX, originY, 5, 5), Color.Magenta); drawer.DrawFilledRectangle(graphicsDevice, r, Color.Red); drawer.DrawFilledRectangle(graphicsDevice, g, Color.Green); drawer.DrawFilledRectangle(graphicsDevice, b, Color.Blue); } drawer.DrawFilledRectangle(graphicsDevice, (Rectangle)(new GameRectangle(0, 0, 2000, 1000)), new Color(0, 0, 0, 220), false); foreach (LevelObject o in objects) { if (o is LightLevelCircle) { o.Draw(drawer, graphicsDevice, batch, font); ((LightLevelCircle)o).SetCulled(cullMode); } } if (textBox.GetSelected()) { textBox.Draw(batch, drawer, font, graphicsDevice); } }