Esempio n. 1
0
		public void Initialize(ScrollBar v, ScrollBar h) {
			this.VerticalSB = v;
			this.HorizontalSB = h;
			this.Texture = null;

			Buffer = new Selection[BUFFER_SIZE];

			for (int i = 0; i < BUFFER_SIZE; i++) {
				Buffer[i] = new Selection {
					                          GridWidth = 1, GridHeight = 1
				                          };
			}
		}
Esempio n. 2
0
		public override void Draw(Microsoft.Xna.Framework.GameTime time) {
			spriteBatch.Begin();

			int x = 0;
			int y = 0;
			try {
				foreach (TileLogicScript logic in TileLogicManager.Instance.logics) {
					Tileset _s_0 = EditorEngine.Instance.GetTilesetByName(logic.s_0);
					int _s_1 = logic.s_1;

					if ((x << 4) + 16 > this.Width) {
						y++;
						x = 0;
					}

					Rectangle srcRect = _s_0.Texture.GetSource(_s_1);
					Rectangle targetRect = new Rectangle(x << 4, (y << 4) - scrollbar.Value, 16, 16);

					spriteBatch.Draw(_s_0.Texture.Texture, targetRect, srcRect, Color.White);
					x += 1;
				}

				this.yMax = y << 4;

				if (!initializedYMax) {
					initializedYMax = true;
					refreshScrollbar();
				}
			} catch (Exception e) {
				Console.WriteLine("Bullshit occured: " + e);
			}

			Selection selection = new Selection();
			selection.Start(new Vector2(xt << 4, yt << 4));
			selection.End(new Vector2(xt << 4, yt << 4));

			SelectionUtil.DrawRectangle(
				spriteBatch,
				Color.Black,
				new Rectangle(
					selection.Region.X * 16 + 1,
					selection.Region.Y * 16 + 1 - this.scrollbar.Value,
					selection.Region.Width * 16,
					selection.Region.Height * 16));

			SelectionUtil.DrawRectangle(
				spriteBatch,
				Color.White,
				new Rectangle(
					selection.Region.X * 16,
					selection.Region.Y * 16 - this.scrollbar.Value,
					selection.Region.Width * 16,
					selection.Region.Height * 16));
			spriteBatch.End();
		}
Esempio n. 3
0
		public ControlEntityEditor() {
			selection = new Selection();
			Template = new EntityTemplate();
		}
Esempio n. 4
0
		public EntityRectangleTool() {
			this.selection = new Selection();
		}
		public override void Draw(Microsoft.Xna.Framework.GameTime gameTime) {
			if (initialized) {
				this.spriteBatch.Begin();
				if (this.sheet != null) {
					this.spriteBatch.Draw(
						this.sheet.Texture.Texture,
						new Vector2(0, -scrollBar.Value),
						Color.White);
				}
				this.spriteBatch.End();

				Selection selection = new Selection();
				selection.Start(new Vector2(xt << 4, yt << 4));
				selection.End(new Vector2(xt << 4, yt << 4));
				SelectionUtil.DrawRectangle(
				this.spriteBatch,
				Color.Black,
				new Rectangle(
					selection.Region.X * 16 + 1,
					selection.Region.Y * 16 + 1 - this.scrollBar.Value,
					selection.Region.Width * 16,
					selection.Region.Height * 16));

				SelectionUtil.DrawRectangle(
					this.spriteBatch,
					Color.White,
					new Rectangle(
						selection.Region.X * 16,
						selection.Region.Y * 16 - this.scrollBar.Value,
						selection.Region.Width * 16,
						selection.Region.Height * 16));
			}
			base.Draw(gameTime);
		}
Esempio n. 6
0
		public override void Initialize(FrmMainEditor mainForm) {
			this.selection = new Selection();
			base.Initialize(mainForm);
		}