mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
2d cels
This commit is contained in:
parent
71bc9077a1
commit
1a37f5e0ad
1 changed files with 19 additions and 0 deletions
|
@ -210,6 +210,25 @@ namespace Beefy.gfx
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Image[] CreateImageCels(int32 cols, int32 rows)
|
||||
{
|
||||
int32 celW = mSrcWidth / cols;
|
||||
int32 celH = mSrcHeight / rows;
|
||||
|
||||
Debug.Assert(celW * cols == mSrcWidth);
|
||||
Debug.Assert(celH * rows == mSrcHeight);
|
||||
|
||||
Image[] celImages = new .[cols * rows];
|
||||
for (int32 row = 0; row < rows; row++)
|
||||
{
|
||||
for (int32 col = 0; col < cols; col++)
|
||||
{
|
||||
celImages[row * cols + col] = CreateImageSegment(col * celW, row * celH, celW, celH);
|
||||
}
|
||||
}
|
||||
return celImages;
|
||||
}
|
||||
}
|
||||
#else
|
||||
public class Image : IDrawable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue