protected override TextureArea CreateTextureArea( TextureArea originalTextureArea, TextureAtlasTextureDefinition definition) { return new CachedTexture( originalTextureArea.TextureId, definition.TopLeft, definition.BottomRight, definition.Width, definition.Height); }
internal CachedTexture(int textureId, Texture texture, string filename, TextureAtlasTextureDefinition textureAtlasTextureDefinition) : base(textureId, textureAtlasTextureDefinition) { Texture = texture; Filename = filename; _createdFromAtlas = true; }
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); }
public override TextureArea Clone(TextureAtlasTextureDefinition textureAtlasTextureDefinition) { return new CachedTexture(TextureId, textureAtlasTextureDefinition); }
private CachedTexture(int textureId, TextureAtlasTextureDefinition textureAtlasTextureDefinition) : base(textureId, textureAtlasTextureDefinition) { }
public override TextureArea Clone(TextureAtlasTextureDefinition definition) { return new CachedTexture(TextureId, Texture, Filename, definition); }
private void UpdateAtlasSection(TextureAreaHolder target, TextureAreaHolder content, TextureAtlasTextureDefinition def) { target.TextureArea = CreateTextureArea(content.TextureArea, def); }
protected abstract TextureArea CreateTextureArea(TextureArea cachedTexture, TextureAtlasTextureDefinition definition);
public abstract TextureArea Clone(TextureAtlasTextureDefinition textureAtlasTextureDefinition);