mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-24 17:29:23 +01:00
added index-based getter to texture atlas
This commit is contained in:
parent
57fcc66054
commit
c9d1fc4b47
1 changed files with 1 additions and 0 deletions
|
@ -11,6 +11,7 @@ namespace MLEM.Textures {
|
|||
public readonly int RegionAmountY;
|
||||
public readonly int RegionWidth;
|
||||
public readonly int RegionHeight;
|
||||
public TextureRegion this[int index] => this[index % this.RegionAmountX, index / this.RegionAmountX];
|
||||
public TextureRegion this[Point point] => this[new Rectangle(point, new Point(1, 1))];
|
||||
public TextureRegion this[int x, int y] => this[new Point(x, y)];
|
||||
public TextureRegion this[Rectangle rect] => this.GetOrAddRegion(rect);
|
||||
|
|
Loading…
Reference in a new issue