public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { String text = mode ? "True" : "False"; Color color = !GetSelected() ? colorA : colorB; Rectangle numRect = this.ToRectangle(); numRect.Width = boolWidth; Rectangle rect = this.ToRectangle(); this.width = (rect.Width = (int)fontHandler.GetVerdana().MeasureString(" " + text + " ").X + 3) + boolWidth; rect.X += boolWidth; primitiveDrawer.DrawRoundedRectangle(graphicsDevice, rect, color); primitiveDrawer.DrawRoundedRectangle(graphicsDevice, numRect, new Color(0x3D, 0x70, 0xBC)); Vector2 vector = this.GetVector(); vector.X += 3; vector.Y += 3; spriteBatch.DrawString(fontHandler.GetVerdana(), " Bool ", vector + TetrisGameRunner.GetOffsetVector(), Color.White); vector.X += boolWidth - 3; spriteBatch.DrawString(fontHandler.GetVerdana(), " " + text + " ", vector + TetrisGameRunner.GetOffsetVector(), Color.White); spriteBatch.End(); spriteBatch.Begin(); }
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { Rectangle numRect = this.ToRectangle(); numRect.Width = strWidth; Rectangle rect = this.ToRectangle(); this.width = (rect.Width = (int)fontHandler.GetVerdana().MeasureString(" " + formatText(fontHandler) + " ").X + 3) + strWidth; rect.X += strWidth; if (this.text.Length > 0 || GetSelected()) if (selected) { primitiveDrawer.DrawRoundedRectangle(graphicsDevice, rect, colorB); } else { primitiveDrawer.DrawRoundedRectangle(graphicsDevice, rect, colorA); } primitiveDrawer.DrawRoundedRectangle(graphicsDevice, numRect, storedColor); Vector2 vector = this.GetVector(); vector.X += 3; vector.Y += 3; spriteBatch.DrawString(fontHandler.GetVerdana(), " Code ", vector + TetrisGameRunner.GetOffsetVector(), Color.White); vector.X += strWidth; spriteBatch.DrawString(fontHandler.GetVerdana(), " " + formatText(fontHandler) + " ", vector + TetrisGameRunner.GetOffsetVector(), Color.White); spriteBatch.End(); spriteBatch.Begin(); }
public void Draw(GraphicsDevice graphicsDevice, SpriteBatch batch, PrimitiveDrawer drawer, FontHandler font) { Vector2 headPlacement = testingRectangle.GetVector(); headPlacement.Y -= 46; headPlacement.X += (testingRectangle.GetWidth() / 2); if(textBox.GetSelected()) textBox.Draw(batch, drawer, font, graphicsDevice); drawer.DrawRoundedRectangle(graphicsDevice, testingRectangle.ScalePosition(-1,-1).ScaleSize(2,2), Color.Black); drawer.DrawRoundedRectangle(graphicsDevice, testingRectangle, color); drawer.DrawCircle(graphicsDevice, headPlacement, 50, Color.Black, sides); drawer.DrawCircle(graphicsDevice, headPlacement, 49, Color.Wheat, sides); Vector2 lower = testingRectangle.GetVector(); lower.Y += 30; lower.X += testingRectangle.GetWidth(); headPlacement.Y += -16; headPlacement.X += -28; // e e\n , ____ , string face = " l l\n"; if (squareOrCircle) face = " n n\n"; bool blinking = false; string face2 = " ____ "; if ((blink > 43 && blink < 56) ) { face = " _ _\n"; blinking = true; } if(blink == 110) { blink = 0; } if(blink % 140 < 15 ) { face2 = " ____ "; } left.Draw(graphicsDevice, batch, drawer, font); right.Draw(graphicsDevice, batch, drawer, font); lleft.Draw(graphicsDevice, batch, drawer, font); lright.Draw(graphicsDevice, batch, drawer, font); Vector2 dis = new Vector2(TetrisGameRunner.GetOffsetX(), TetrisGameRunner.GetOffsetY()); batch.DrawString(font.GetVerdana(), "Frame : " + ff + " "+"S: Save Frame C: Correct Frame V: Correct Frame Dynamic\nH: Hide Dots", new Vector2(300, 0) + dis, Color.White); batch.DrawString(((!blinking) ? font.GetWingdings() : font.GetVerdana()), face, headPlacement + dis, Color.Black); batch.DrawString(font.GetVerdana(), "\n\n", testingRectangle.GetVector(), Color.Black, 0, dis + new Vector2(), .82f, SpriteEffects.None, 0); batch.DrawString(font.GetVerdana(), "\n"+face2, dis + headPlacement, Color.Black); }
public void Draw(GraphicsDevice graphicsDevice, SpriteBatch batch, PrimitiveDrawer drawer, FontHandler font) { if(showMode && !neverEditAgain) { drawer.DrawRoundedRectangle(graphicsDevice, a.ScalePosition(start), Color.White); drawer.DrawRoundedRectangle(graphicsDevice, b.ScalePosition(start), Color.Red); drawer.DrawRoundedRectangle(graphicsDevice, c.ScalePosition(start), Color.Blue); } drawer.DrawCurve(graphicsDevice, start, a.ScalePosition(start).GetVector(), b.ScalePosition(start).GetVector(), c.ScalePosition(start).GetVector(), 1, 0, Color.Black); }
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { if(varLink != null) { Vector2 vec = this.GetVector(); this.varLink.SetVector(ref vec); this.SetWidth(varLink.GetWidth()); this.SetHeight(varLink.GetHeight()); varLink.Draw(spriteBatch, primitiveDrawer, fontHandler, graphicsDevice); } else { primitiveDrawer.DrawRoundedRectangle(graphicsDevice, this, colorA); Vector2 ve = fontHandler.GetVerdana().MeasureString(this.typeOfVariable); this.width = (int)ve.X + 3; this.height = 30; Vector2 vec = this.GetVector(); vec.Y += 3; vec.X += 3; spriteBatch.DrawString(fontHandler.GetVerdana(), this.typeOfVariable, vec + TetrisGameRunner.GetOffsetVector(), Color.White); spriteBatch.End(); spriteBatch.Begin(); } }
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { SetWidth((int)fontHandler.GetVerdana().MeasureString(this.eventName).X + 8); Vector2 adjust = GetVector(); adjust.X += 4; spriteBatch.DrawString(fontHandler.GetVerdana(), this.eventName, adjust + TetrisGameRunner.GetOffsetVector(), Color.White); primitiveDrawer.DrawRoundedRectangle(graphicsDevice, this, Color.Green); spriteBatch.End(); spriteBatch.Begin(); }
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { if (width == 0) { Vector2 measure = fontHandler.GetLucidaSansTypewriter().MeasureString(" New Class "); this.width = (int)measure.X; this.height = (int)measure.Y; } primitiveDrawer.DrawRoundedRectangle(graphicsDevice, this, Color.Orange); spriteBatch.DrawString(fontHandler.GetLucidaSansTypewriter(), " New Class ", TetrisGameRunner.GetOffsetVector() +this.GetVector(), Color.White); spriteBatch.End(); spriteBatch.Begin(); }
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { Vector2 vec = this.GetVector(); holderA.SetVector(ref vec); vec.X += holderA.GetWidth() + 1; Rectangle rect = this.ToRectangle(); rect.X = (int)vec.X; rect.Y = (int)vec.Y; rect.Width = 28; vec.X += 29; spriteBatch.DrawString(fontHandler.GetVerdana(), modes[mode], new Vector2(rect.X, rect.Y) + TetrisGameRunner.GetOffsetVector(), Color.White); holderB.SetVector(ref vec); this.width = holderA.GetWidth() + holderB.GetWidth() + 30; primitiveDrawer.DrawRoundedRectangle(graphicsDevice, rect, storedColor); holderA.Draw(spriteBatch, primitiveDrawer, fontHandler, graphicsDevice); holderB.Draw(spriteBatch, primitiveDrawer, fontHandler, graphicsDevice); }
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { Rectangle numRect = this.ToRectangle(); numRect.Width = notWidth; this.width = notWidth + holder.GetWidth(); primitiveDrawer.DrawRoundedRectangle(graphicsDevice, numRect, storedColor); Vector2 vector = this.GetVector(); vector.X += 3; vector.Y += 3; spriteBatch.DrawString(fontHandler.GetVerdana(), modes[mode], vector + TetrisGameRunner.GetOffsetVector(), Color.White); vector.X += notWidth - 2; vector.Y -= 3; holder.SetVector(ref vector); holder.Draw(spriteBatch, primitiveDrawer, fontHandler, graphicsDevice); spriteBatch.End(); spriteBatch.Begin(); }
public void Draw(SpriteBatch batch, FontHandler handler, GraphicsDevice graphics, PrimitiveDrawer drawer) { drawer.DrawRoundedRectangle(graphics, this, col); batch.DrawString(handler.GetVerdana(), text, GetVector() + new Vector2(20, 10), Color.Black); }
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice) { if(selected) { primitiveDrawer.DrawRoundedRectangle(graphicsDevice, this, colorB); } else { primitiveDrawer.DrawRoundedRectangle(graphicsDevice, this, colorA); } Vector2 vector = this.GetVector() + new Vector2(TetrisGameRunner.GetOffsetX(), TetrisGameRunner.GetOffsetY()); vector.X += 3; vector.Y += 3; spriteBatch.DrawString(fontHandler.GetVerdana(), formatText(fontHandler), vector, Color.White); spriteBatch.End(); spriteBatch.Begin(); }