Beispiel #1
0
 protected override TextureArea CreateTextureArea(
     TextureArea originalTextureArea, TextureAtlasTextureDefinition definition)
 {
     return new CachedTexture(
         originalTextureArea.TextureId, definition.TopLeft,
         definition.BottomRight, definition.Width, definition.Height);
 }
Beispiel #2
0
 internal CachedTexture(int textureId, Texture texture, string filename, 
     TextureAtlasTextureDefinition textureAtlasTextureDefinition)
     : base(textureId, textureAtlasTextureDefinition)
 {
     Texture = texture;
     Filename = filename;
     _createdFromAtlas = true;
 }
Beispiel #3
0
        protected TextureArea(int textureId, TextureAtlasTextureDefinition textureAtlasTextureDefinition)
        {
            TextureId = textureId;
            // todo: use a Rectangle
            AtlasTopLeft = textureAtlasTextureDefinition.TopLeft;
            AtlasBottomRight = textureAtlasTextureDefinition.BottomRight;
            AtlasBottomLeft = new Vector2(textureAtlasTextureDefinition.TopLeft.X, textureAtlasTextureDefinition.BottomRight.Y);
            AtlasTopRight = new Vector2(textureAtlasTextureDefinition.BottomRight.X, textureAtlasTextureDefinition.TopLeft.Y);
            Width = textureAtlasTextureDefinition.Width;
            Height = textureAtlasTextureDefinition.Height;

            Size = new Vector2(Width, Height);
        }
Beispiel #4
0
 public override TextureArea Clone(TextureAtlasTextureDefinition textureAtlasTextureDefinition)
 {
     return new CachedTexture(TextureId, textureAtlasTextureDefinition);
 }
Beispiel #5
0
 private CachedTexture(int textureId, TextureAtlasTextureDefinition textureAtlasTextureDefinition)
     : base(textureId, textureAtlasTextureDefinition)
 {
 }
Beispiel #6
0
 public override TextureArea Clone(TextureAtlasTextureDefinition definition)
 {
     return new CachedTexture(TextureId, Texture, Filename, definition);
 }
Beispiel #7
0
 private void UpdateAtlasSection(TextureAreaHolder target, TextureAreaHolder content, TextureAtlasTextureDefinition def)
 {
     target.TextureArea = CreateTextureArea(content.TextureArea, def);
 }
Beispiel #8
0
 protected abstract TextureArea CreateTextureArea(TextureArea cachedTexture, TextureAtlasTextureDefinition definition);
Beispiel #9
0
 public abstract TextureArea Clone(TextureAtlasTextureDefinition textureAtlasTextureDefinition);