public void LoadTileset(Texture2D texture) {
			Tileset = new Tileset("splittertileset", EditorEngine.Instance.World.TilesetFactory);
			Tileset.Texture = new TileableTexture(texture);

			int xt = texture.Width >> 4;
			int yt = texture.Height >> 4;

			hscrollbar.Maximum = xt << 4;
			vscrollbar.Maximum = yt << 4;

			Tileset.Texture.Columns = texture.Width >> 4;
			Tileset.Texture.Rows = texture.Height >> 4;

			Tileset.GenerateTiles();

			Random rand = new Random();

			//Reset points
			for (int i = 0; i < points.Length; i++) {
				points[i].Clear();
			}

			//Scramble colors
			ScrambleColors();
		}
示例#2
0
		public override void LoadContent() {
			batch = new SpriteBatch(GraphicsDevice);
			base.LoadContent();
			Tileset = null;
			using (MemoryStream stream = new MemoryStream()) {
				MapEditor.Data.Resources.ox.Save(stream, ImageFormat.Png);
				ox = new TileableTexture(Texture2D.FromStream(EditorEngine.Instance.GraphicsDevice, stream), 2, 1);
			}
		}
示例#3
0
		public object Clone() {
			Tileset tileset = new Tileset();
			Tile[] tiles = this.Tiles.ToArray();

			tileset.Tiles.AddRange(tiles);
			tileset.Name = (string)this.Name.Clone();
			tileset.Texture = (TileableTexture)this.Texture.Clone();

			return tileset;
		}
示例#4
0
		public void addTileset(Tileset tilesheet) {
			World.TilesetContainer.Add(tilesheet);
		}