- 1945_Code_Package.zip
- 1945 Code Package
- 1945_Demo_Package.zip
- 1945_Demo_Package
- Game.icproj
- IceCream.dll
- IceCream1945.exe
- IceCream1945Content
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- Music
- Sounds
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
- 1945_demo_package-noexe.zip
- Game.icproj
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
- 1945_demo_package.zip
- Game.icproj
- IceCream.dll
- IceCream1945.exe
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
- 1945_Demo_Package-noexe.zip
- Game.icproj
- 1945.xml
- 1945.xnb
- Ending.icescene
- EnemyBulletsAndIslands.xml
- EnemyBulletsAndIslands.xnb
- global.ice
- Level1.icescene
- ExplosionBomb.xnb
- ExplosionHit.xnb
- Laser_Shoot_Player.xnb
- Laser_Shoot_Turret.xnb
- Laser_Shoot3.xnb
- Quick_Hit.xnb
- Splash.icescene
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using IceCream;
using IceCream.Drawing;
using IceCream.SceneItems;
using MilkshakeLibrary;
using Milkshake.SelectorDialogs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using XPTable;
using XPTable.Models;
using Rectangle = Microsoft.Xna.Framework.Rectangle;
using Point = Microsoft.Xna.Framework.Point;
using XnaColor = Microsoft.Xna.Framework.Color;
namespace Milkshake.Editors.TileSheetEditor
{
public partial class TileSheetEditor : SceneItemEditor
{
public static TileSheetEditor Instance;
public override SceneItem SceneItem
{
get
{
return base.SceneItem;
}
set
{
base.SceneItem = value;
}
}
internal TileSheet TileSheet
{
get;
set;
}
private int _selectedBrushTile = 0;
internal int SelectedBrushTile
{
get { return _selectedBrushTile; }
set { _selectedBrushTile = value; }
}
public TileSheetEditor()
{
InitializeComponent();
this.TileSheet = new TileSheet();
TileSheetEditor.Instance = this;
}
private void TileGridEditor_Load(object sender, EventArgs e)
{
labelTextureName.Text = TileSheet.Material.ToString();
checkBoxUseSafeBorder.Checked = TileSheet.UseTilingSafeBorders;
textBoxTileWidth.Text = TileSheet.TileSize.X.ToString(CultureInfo.InvariantCulture);
textBoxTileHeight.Text = TileSheet.TileSize.Y.ToString(CultureInfo.InvariantCulture);
}
#region Properties tab event
private void buttonSelectTexture_Click(object sender, EventArgs e)
{
MaterialSelectorDialog materialSelectorDialog = new MaterialSelectorDialog();
materialSelectorDialog.SelectedMaterial = this.TileSheet.Material;
materialSelectorDialog.ShowLocalTextures = ItemIsLocal;
if (materialSelectorDialog.ShowDialog() == DialogResult.OK)
{
this.TileSheet.Material = materialSelectorDialog.SelectedMaterial;
labelTextureName.Text = materialSelectorDialog.SelectedMaterial.ToString();
}
}
private void checkBoxUseSafeBorder_CheckedChanged(object sender, EventArgs e)
{
this.TileSheet.UseTilingSafeBorders = checkBoxUseSafeBorder.Checked;
}
private void textBoxTileWidth_Validated(object sender, EventArgs e)
{
try
{
int newW = int.Parse(textBoxTileWidth.Text, System.Globalization.CultureInfo.InvariantCulture);
this.TileSheet.TileSize = new Point(newW, this.TileSheet.TileSize.Y);
}
catch (Exception ex)
{
if (ex != null)
{
textBoxTileWidth.Text = this.TileSheet.TileSize.X.ToString(CultureInfo.InvariantCulture);
}
}
}
private void textBoxTileHeight_Validated(object sender, EventArgs e)
{
try
{
int newH = int.Parse(textBoxTileHeight.Text, System.Globalization.CultureInfo.InvariantCulture);
this.TileSheet.TileSize = new Point(this.TileSheet.TileSize.X, newH);
}
catch (Exception ex)
{
if (ex != null)
{
textBoxTileHeight.Text = this.TileSheet.TileSize.Y.ToString(CultureInfo.InvariantCulture);
}
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.