public void SetDrawInformation(DrawInformation drawInfo) { this.drawInformation = drawInfo; drawInformation.SetPixelShader(GUID_RipplePixelShader, PixelOptions.None); drawInformation.SetInputDescription(0, new InputDescription(Filter.MinimumMagLinearMipPoint, 1)); }
public void SetDrawInformation(DrawInformation drawInfo) { this.drawInformation = drawInfo; drawInformation.SetVertexProcessing( vertexBuffer, VertexOptions.UseDepthBuffer, null, new VertexRange(0, numberOfVertices), GUID_WaveVertexShader ); }
public void Draw(SpriteBatch batch, DrawInformation information) { if (_isLight != information.DrawLights) return; for (int index = 0; index < _particles.Count; index++) { _particles[index].Draw(Game1.Instance.SpriteBatch,information); } }
public void Draw(SpriteBatch spriteBatch,DrawInformation information) { Rectangle sourceRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height); Vector2 origin = new Vector2(Texture.Width / 2, Texture.Height / 2); Vector2 _loc = information.Position; Vector2 _size = new Vector2(Size,Size); if (information.Centered) _loc = information.Position - (_size / 2); else _loc = information.Position; Vector2 center = Game1.Instance.Camera.Center; Rectangle bounds = Game1.Instance.Window.ClientBounds; // spriteBatch.Draw(Texture, new Rectangle((int)_loc.X - (int)center.X + (int)Math.Round(bounds.Width / 2.0f), // (int)_loc.Y - (int)center.Y + (int)Math.Round(bounds.Height / 2.0f), (int)_size.X, (int)_size.Y), // new Rectangle(0, 0, (int)_size.X, (int)_size.Y), Color.White, information.Rotation, _size / 2, SpriteEffects.None, 0.5f); spriteBatch.Draw(Texture, information.Position-center+PositionOffset+new Vector2((float)Math.Round(bounds.Width / 2.0f),(float)Math.Round(bounds.Height / 2.0f)), sourceRectangle, Color*Alpha, Angle, origin, Size, SpriteEffects.None, 0f); }