private void FrmMap_Load(object sender, EventArgs e) { Graphics.CSprite.initFrameRateMapping(); foreach (KeyValuePair <string, Graphics.CTextureAtlas> tileset in Graphics.CTextures.textures) { if (tileset.Value.isTileSet) { cmbTilesets.Items.Add(tileset.Key); King_of_Thieves.Graphics.CSprite sprite = txvTextures.changeSprite(tileset.Key, tileset.Value); _atlasCache.Add(tileset.Key, sprite); } } populateNameSpaceList(); populateActorList("all"); cmbTilesets.SelectedIndex = 0; cmbLayers.SelectedIndex = 0; cmbActorList.SelectedIndex = 0; _newMap(); tile = txvTextures.selectTile(hsbTexture.Value, vsbTexture.Value); }
public King_of_Thieves.Map.CTile selectTile(int offSetX = 0, int offSetY = 0) { System.Drawing.Point mousePos = PointToClient(MousePosition); int snapX = (int)System.Math.Floor((mousePos.X + offSetX) / 16.0); int snapY = (int)System.Math.Floor((mousePos.Y + offSetY) / 16.0); selectorRect.X = snapX * 16; selectorRect.Y = snapY * 16; King_of_Thieves.Map.CTile tile = new King_of_Thieves.Map.CTile(new Vector2(snapX, snapY), Vector2.Zero, _currentSprite.atlasName); _currentTile = tile; return(tile); }
private void txvTextures_Click(object sender, EventArgs e) { tile = txvTextures.selectTile(hsbTexture.Value, vsbTexture.Value); if (_animationSelectMode) { if (_animStart.X == -1) { _animStart = tile.atlasCoords; } else { _animEnd = tile.atlasCoords; tile = txvTextures.selectAnimatedTile(_animStart, _animEnd); _animationSelectMode = false; btnNewAnimated.BackColor = System.Drawing.Color.Transparent; _animStart = new Vector2(-1, -1); _animEnd = new Vector2(-1, -1); } } mpvMapView.changeSelectedTile(tile); }
public King_of_Thieves.Map.CAnimatedTile selectAnimatedTile(Vector2 atlasStart, Vector2 atlasEnd) { King_of_Thieves.Map.CAnimatedTile tile = new King_of_Thieves.Map.CAnimatedTile(atlasStart, atlasEnd, Vector2.Zero, _currentSprite.atlasName, 1); _currentTile = tile; return(tile); }