Ejemplo n.º 1
0
        public void draw(Texture2D texture, SpriteBatch spriteBatch, BallSimulation ballSimulation)
        {
            spriteBatch.Begin();

            float scale = camera.getScale(ballSimulation.getHitRadius(),texture.Width * 1.15f);

            spriteBatch.Draw(texture, camera.getViewCoords(this.position, texture.Width, texture.Height), texture.Bounds, Color.White, 0f,Vector2.Zero, scale, SpriteEffects.None, 0);

            spriteBatch.End();
        }
Ejemplo n.º 2
0
        public void Draw(SpriteBatch spriteBatch, Texture2D ball, BallSimulation bs)
        {
            float scale = camera.getScale(bs.ballRadius(), ball.Width/2);

            spriteBatch.Begin();

            spriteBatch.Draw(ball, camera.getViewCoords(bs.position(), ball.Width, ball.Height), ball.Bounds, Color.White, 0, Vector2.Zero , scale, SpriteEffects.None, 0);

            spriteBatch.End();
        }