//SpriteBatch spriteBatch; public TextAnnotation(String words, Vector2 position, ContentManager content) { Position = position; Words = words; TextColor = GlobalLineColor.GetValueOrDefault(Color.Transparent); Font = content.Load <SpriteFont>("textAnnotation"); }
public LineAnnotation(Vector3 start, Vector3 end) { vertices = new VertexPositionColor[2] { new VertexPositionColor(start, GlobalLineColor.GetValueOrDefault(Color.Black)), new VertexPositionColor(end, GlobalLineColor.GetValueOrDefault(Color.Black)) }; }
public override void Draw() { vertices[0].Color = GlobalLineColor.GetValueOrDefault(Color.Black); vertices[1].Color = GlobalLineColor.GetValueOrDefault(Color.Black); foreach (EffectPass pass in BasicEffect.CurrentTechnique.Passes) { pass.Apply(); BasicEffect.GraphicsDevice.DrawUserPrimitives <VertexPositionColor> (PrimitiveType.LineList, vertices, 0, 1); } }
public override void Draw() { foreach (EffectPass pass in BasicEffect.CurrentTechnique.Passes) { TextColor = GlobalLineColor.GetValueOrDefault(Color.Black); //new TextAnnotation(Words, Position); pass.Apply(); spriteBatch = new SpriteBatch(BasicEffect.GraphicsDevice); spriteBatch.Begin(); spriteBatch.DrawString(Font, Words, Position, TextColor); spriteBatch.End(); } }
public override void Draw() { for (int i = 0; i < lineverts.Length; i++) { lineverts[i].Color = GlobalLineColor.GetValueOrDefault(Color.Black); } for (int i = 0; i < vertices.Length; i++) { vertices[i].Color = GlobalFillColor.GetValueOrDefault(Color.Transparent); } foreach (EffectPass pass in BasicEffect.CurrentTechnique.Passes) { pass.Apply(); BasicEffect.GraphicsDevice.DrawUserPrimitives <VertexPositionColor>(PrimitiveType.TriangleList, vertices, 0, 51, VertexPositionColor.VertexDeclaration); BasicEffect.GraphicsDevice.DrawUserPrimitives <VertexPositionColor>(PrimitiveType.LineStrip, lineverts, 0, lineverts.Length - 1); } }