public IDisposable SubscribeText(Transform2 transform, TextSprite sprite) { Action handler = () => spriteBatch.DrawString( sprite.Font, sprite.Text, PixelsPerMeter * transform.Position, sprite.Color, transform.Rotation, sprite.Origin, scaleCorrection * transform.Scale, sprite.Effects, sprite.LayerDepth); draw += handler; return(Disposable.Create(() => draw -= handler)); }
public IDisposable SubscribeText(Transform2 transform, TextSprite sprite) { Action handler = () => spriteBatch.DrawString( sprite.Font, sprite.Text, PixelsPerMeter * transform.Position, sprite.Color, transform.Rotation, sprite.Origin, scaleCorrection * transform.Scale, sprite.Effects, sprite.LayerDepth); draw += handler; return Disposable.Create(() => draw -= handler); }