Exemplo n.º 1
0
 public SpriteSheetAnimation(SpriteSheetAnimationCreationData creationData)
     : base("<GeneratedSpriteSheetAnimation>")
 {
     Image           = creationData.Image;
     DefaultDuration = creationData.DefaultDuration;
     SubImageSize    = creationData.SubImageSize;
     CreateUVs();
 }
Exemplo n.º 2
0
 public SpriteSheetAnimation(SpriteSheetAnimationCreationData creationData)
     : base("<GeneratedSpriteSheetAnimation>")
 {
     Image = creationData.Image;
     DefaultDuration = creationData.DefaultDuration;
     SubImageSize = creationData.SubImageSize;
     CreateUVs();
 }
Exemplo n.º 3
0
 public void CreateSpriteSheetAnimationWithNewTexture()
 {
     var data = new ImageCreationData(new Size(8, 8)) { BlendMode = BlendMode.Opaque };
     var image = ContentLoader.Create<Image>(data);
     FillImage(image);
     var animationData = new SpriteSheetAnimationCreationData(image, 2, new Size(2, 2));
     var texturedShader = ContentLoader.Load<Shader>(Shader.Position2DUV);
     var newMaterial = new SpriteSheetAnimation(animationData).CreateMaterial(texturedShader);
     new Sprite(newMaterial, Rectangle.HalfCentered);
 }