Beispiel #1
0
 public void drawTexture(Texture texture, float x, float y, float width, float height, bool flipY)
 {
     if (texture.getUAddressMode() != _currentUMode || texture.getVAddressMode() != _currentVMode)
     {
         _currentUMode = texture.getUAddressMode();
         _currentVMode = texture.getVAddressMode();
         updateAddressMode();
     }
     _spriteBatch.Draw(((MonoGameTexture)texture).texture2D, (new Vector2(x, y) + _translation - _rotationCenter) * _scale, null, _tint, 0,
                       Vector2.Zero, new Vector2(width / texture.getWidth(), height / texture.getHeight()) * _scale,
                       flipY ? SpriteEffects.FlipVertically : SpriteEffects.None, 0f);
 }
Beispiel #2
0
        public void drawTexture(Texture texture, float x, float y, float width, float height, bool flipY)
        {
            beginRendering();
            if (texture.getUAddressMode() != _currentUMode || texture.getVAddressMode() != _currentVMode)
            {
                _currentUMode = texture.getUAddressMode();
                _currentVMode = texture.getVAddressMode();
                updateAddressMode();
            }

            _sharedPositionVector.X = x;
            _sharedPositionVector.Y = y;
            _sharedScaleVector.X    = width / texture.getWidth();
            _sharedScaleVector.Y    = height / texture.getHeight();
            _spriteBatch.Draw(((MonoGameTexture)texture).texture2D, _sharedPositionVector, null, _tint, 0,
                              Vector2.Zero, _sharedScaleVector, flipY ? SpriteEffects.FlipVertically : SpriteEffects.None, 0f);
        }