added documentation and cleaned up some parameters. Added obtain and draw functions to the skin class.

This commit is contained in:
2018-12-11 20:03:35 -06:00
parent 081f84cd47
commit 8ddb79c135
3 changed files with 50 additions and 15 deletions

View File

@@ -25,9 +25,19 @@ namespace RecrownedAthenaeum.UI.Skin
definitions = new Dictionary<Type, Dictionary<string, ISkinDefinition>>();
}
public void Draw(string texture, string color, Rectangle region)
public void Draw(string regionName, string color, SpriteBatch batch, Rectangle destination, Type type, float rotation = 0, Vector2 origin = default(Vector2))
{
textureAtlas.Draw(regionName, batch, destination, colors[color], rotation, origin);
}
public ISkinDefinition ObtainDefinition(string definitionName, Type type)
{
return definitions[type][definitionName];
}
public T ObtainDefinition<T>(string definitionName) where T : ISkinDefinition
{
return (T)definitions[typeof(T)][definitionName];
}
public void AddDefinition(string definitionName, ISkinDefinition skinDefinition)