public SetTile ( int x, int y, int value ) : void | ||
x | int | |
y | int | |
value | int | |
return | void |
public void SetTile(int x, int y, int value)
{
if (GetTile(x,y) != value) {
tileDataFile.Position = y*fileWidth+x;
tileDataFile.WriteByte((byte)value);
if (cachedImage != null) {
Graphics g = Graphics.FromImage(cachedImage);
g.DrawImageUnscaled(area.GetTileImage(value), x*16, y*16);
g.Dispose();
}
Modified = true;
if (RoomModifiedEvent != null)
RoomModifiedEvent();
}
}
void OnClicked(int x, int y) { x /= TileWidth; y /= TileHeight; if (!ViewObjects) { room.SetTile(x, y, client.SelectedIndex); this.QueueDrawArea(x * TileWidth, y * TileWidth, TileWidth - 1, TileHeight - 1); } else { if (objectEditor != null) { ObjectGroupEditor editor = objectEditor; while (hoveringObjectIndices.Count > 1) { editor.SelectedIndex = hoveringObjectIndices[0]; hoveringObjectIndices.RemoveAt(0); editor = editor.SubEditor; } if (hoveringObjectIndices.Count == 1) { editor.SelectedIndex = hoveringObjectIndices[0]; draggingObject = true; } } } }