Files
PCK-Studio/PckStudio.Core/Atlas/AtlasOverlayGroup.cs

31 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PckStudio.Core.Json;
namespace PckStudio.Core
{
internal class AtlasOverlayGroup : AtlasGroup
{
private JsonRowAndColumn _overlayAtlasLocation;
public AtlasOverlayGroup(string name, int row, int column, JsonRowAndColumn overlayAtlasLocation, bool allowCustomColor)
: base(name, row, column, allowCustomColor)
{
_overlayAtlasLocation = overlayAtlasLocation;
}
protected override bool isAnimation => false;
protected override bool isLargeTile => false;
protected override bool isComposedOfMultipleTiles => true;
public override Size GetSize(Size tileSize) => tileSize;
internal override Rectangle[] GetTileArea(Size tileSize) => [new Rectangle(new Point(Row * tileSize.Width, Column * tileSize.Height), tileSize), new Rectangle(new Point(_overlayAtlasLocation.Row * tileSize.Width, _overlayAtlasLocation.Column * tileSize.Height), tileSize)];
}
}