protected override void DrawFrame(GameTime gameTime, XnaRenderer renderer) { Vector2 mp = base.GetMousePosition(); mp = _camera.ViewToWorld(mp); renderer.BeginDraw(_camera); foreach (Polygon p in _polygons) { p.Draw(renderer); } renderer.DrawPoint(mp, _cursorSize, Color.Lerp(Color.Green, Color.Cyan, (_cursorSize - 2) / 2), 1f); if (_stage == 0) { renderer.DrawArrow(_forceStart, _forceEnd, 0.2f, Color.Green); } foreach (Arrow arrow in ArrowCollection.Arrows.Values) { renderer.DrawArrow(arrow.Start, arrow.End, 0.1f, arrow.Color); } renderer.DrawPoint(Vector2.Zero, 0.2f, Color.Red, 0.5f); renderer.EndDraw(); }
protected override void DrawFrame(GameTime gameTime, XnaRenderer renderer) { renderer.BeginDraw(_camera); foreach (FireFly fly in _fireFlies) { fly.Draw(renderer); } renderer.EndDraw(); }
protected override void DrawFrame(GameTime gameTime, XnaRenderer renderer) { renderer.BeginDraw(_camera); renderer.DrawPoint(new Vector2(100, 100) + Util.AngleToVector(_angle) * 20f, 5f, Color.Green, 1f); //_camera.Zoom = 0.5f; //renderer.DrawString("This is some text", new Vector2(0, 0), Color.Red); renderer.EndDraw(); }
protected override void DrawFrame(GameTime gameTime, XnaRenderer renderer) { renderer.Clear(Color.White); Vector2 start = new Vector2(0, 0); Vector2 end = start + Util.AngleToVector(_angle) * _lineLength; renderer.BeginDraw(_camera); renderer.DrawPoint(start, 3f, Color.Green, 1f); renderer.DrawPoint(end, 3f, Color.Red, 1f); renderer.DrawArrow(start, end, 0.5f, Color.Black, 1f); renderer.EndDraw(); }
protected override void DrawFrame(GameTime gameTime, XnaRenderer renderer) { //Texture2D texture = renderer.ContentManager.Load<Texture2D>("solid"); //Effect effect = renderer.ContentManager.Load<Effect>("basicshader.mgfxo"); //effect.Parameters["xWorld"].SetValue(_camera.World); //effect.Parameters["xProjection"].SetValue(_camera.Projection); //effect.Parameters["xView"].SetValue(_camera.View); //effect.Parameters["TextureSampler"].SetValue(texture); //effect.Techniques["Basic"].Passes[0].Apply(); //renderer.GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, _vertexData, 0, 4, _indexData, 0, 2, VertexPositionColorTexture.VertexDeclaration); renderer.BeginDraw(_camera); LiteEngine.Textures.Texture solidTexture = new LiteEngine.Textures.Texture("solid"); renderer.DrawDepth = 0.9f; DrawTiles(renderer); renderer.DrawDepth = 0.7f; //this sprite will rotate around it's top corner (20,20) renderer.DrawSprite(solidTexture, new RectangleF(20, 20, 20, 2f), Color.Red, _angle); //this sprite will rotate around it's center placed at (30,30) renderer.DrawSprite(solidTexture, new Vector2(30, 30), new Vector2(20, 2), _angle); //this sprite will rotate around it's center placed at (70,20) renderer.DrawSprite(solidTexture, new RectangleF(70, 20, 20, 2f), renderer.DrawDepth, _angle, new Vector2(0.5f, 0.5f), Color.Red); renderer.DrawPoint(new Vector2(0, 0), 1f, Color.White, 1f); renderer.DrawSprite(_stickmanAnimation.CurrentTexture, new RectangleF(10, 60, 30, 30)); _stickmanAnimation.Advance(gameTime.ElapsedGameTime.Milliseconds); //renderer.DrawSprite(new LiteEngine.Textures.Texture("point"), new RectangleF(2, 0, 1, 1), 0.5f, _angle, new Vector2(0.5f,0.5f), Color.Blue); //renderer.DrawSprite(new LiteEngine.Textures.Texture("point", new RectangleI(0, 0, 32, 32)), new RectangleF(2, 0, 1, 1), 0.5f, _angle, new Vector2(0.5f, 0.5f), Color.Blue); //draw non-rectangular sprite centered and rotating around (50,50) DrawNonRectangular(renderer, new Vector2(50, 50), new Vector2(0.5f, 0.5f)); //draw non-rectangular sprite rotating around its bottom right corner at (70,70) DrawNonRectangular(renderer, new Vector2(70, 70), new Vector2(1f, 1f)); //draw a non rectangular texture _angle += 0.01f; renderer.EndDraw(); }
protected override void DrawFrame(GameTime gameTime, XnaRenderer renderer) { renderer.BeginDraw(_camera); renderer.DrawDepth = 0.9f; _world.Draw(renderer); renderer.DrawDepth = 0.5f; renderer.Transformation = Matrix.Identity; _snake.Draw(renderer); renderer.EndDraw(); //renderer.BeginDraw(_screenCamera); //renderer.DrawString("5", new Vector2(0, 0), Color.Black, 10); //renderer.EndDraw(); }