Level Creator won't load .png and .xnb at the same time from content.mgcb?
Hi again all,
Another small issue regarding the content pipeline of monogame, I have been having issues when creating a level editor for my 2D game I am making for a uni assignment. basically, it's a project that uses a winform I use and requires to be able to access the .png and the .xnb at the same time. I do not however how to translate this knowledge into monogames content pipeline because the properties of the .mgcb may be the same, but do not give me the same outcome.
I was hoping someone here might know how to do this?
public partial class MapEditor : Form
{
public Game1 game;
public MapEditor()
{
InitializeComponent();
}
private void LoadImageList()
{
string filepath = Application.StartupPath +
@"Textures/Tiles.png";
Bitmap tileSheet = new Bitmap(filepath);
int tilecount = 0;
for (int y = 0; y < tileSheet.Height / TileMap.TileHeight; y++)
{
for (int x = 0; x < tileSheet.Width / TileMap.TileWidth; x++)
{
Bitmap newBitmap = tileSheet.Clone(new
System.Drawing.Rectangle(
x * TileMap.TileWidth,
y * TileMap.TileHeight,
TileMap.TileWidth,
TileMap.TileHeight),
System.Drawing.Imaging.PixelFormat.DontCare);
imgListTiles.Images.Add(newBitmap);
string itemName = "";
if (tilecount == 0)
{
itemName = "Empty";
}
if (tilecount == 1)
{
itemName = "White";
}
listTiles.Items.Add(new
ListViewItem(itemName, tilecount++));
}
}
I can't link images due to being new to the site, but if you need an image of what I'm trying to do please let me know!
Edit: One of my team members altered the way the bitmap loaded in to prevent the error.
Unfold
Level Creator won't load .png and .xnb at the same time from content.mgcb? by
Frostheart, 03 Mar 2016 06:58