Esempio n. 1
0
 public SpriteSheetAnimation(SpriteSheetAnimationCreationData creationData)
     : base("<GeneratedSpriteSheetAnimation>")
 {
     Image           = creationData.Image;
     DefaultDuration = creationData.DefaultDuration;
     SubImageSize    = creationData.SubImageSize;
     CreateUVs();
 }
Esempio n. 2
0
 public SpriteSheetAnimation(SpriteSheetAnimationCreationData creationData)
     : base("<GeneratedSpriteSheetAnimation>")
 {
     Image = creationData.Image;
     DefaultDuration = creationData.DefaultDuration;
     SubImageSize = creationData.SubImageSize;
     CreateUVs();
 }
Esempio 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);
 }