Esempio n. 1
0
        private void ClipSprite <TSurface, TSource>(string spriteName, string spritesheet, Rectangle spriteBounds, IGraphicsContext <TSurface, TSource> graphicsContext, ISpriteManager <TSource> spriteManager)
        {
            TSurface target = graphicsContext.CreateTarget(spriteBounds.Width, spriteBounds.Height);

            graphicsContext.Draw(spriteManager[spritesheet], target, new Rectangle(0, 0, spriteBounds.Width, spriteBounds.Height), spriteBounds);
            spriteManager[spriteName] = graphicsContext.TargetToSource(target);
        }
Esempio n. 2
0
 public TSource TargetToSource(TSurface target) => GraphicsContext.TargetToSource(target);