コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }