void TilesetEditor::addNewTile (int id) { int i = tiles.size(); GraphicsTileItem *item = new GraphicsTileItem(oldTilesWidth, oldTilesHeight, tiles.size()+1); item->setTileId(id); m_scene->addItem(item); item->setPos((i%6)*oldTilesWidth, (i/6)*oldTilesHeight); item->setShowPolicy(displayProperties->isChecked()); tiles.append(item); tilesId.append(id); refreshGeometry(); }
void TilesetEditor::numberOfTilesChanged(int newNumber) { int dif = newNumber - tiles.size(); if (dif < 0) { for (int i=0; i<(-dif); i++) delete tiles.at(tiles.size()-i-1); tiles.resize(newNumber); tilesId.resize(newNumber); refreshGeometry(); } else if (dif > 0) { QPersistentModelIndex projectIndex = m_projectWidget->projectOfIndex(m_tilesetIndex); for (int i=0; i<dif; i++) { addNewTile (); } } }
void loadMap(int i) { Heightmap* hm = Heightmap::loadPGM(mapFilename); delete map; if(hm) { map = hm; errorMessageLabel->set_text(""); sceneTransform.translation.data[2] = -min(hm->width, hm->height) / 2; } else { map = NULL; errorMessageLabel->set_text("*** ERROR: file cannot be opened."); } refreshGeometry(i); }
void TilesetEditor::setDisplayProperties(bool display) { for (int i=0; i<tiles.size(); i++) { tiles.at(i)->setShowPolicy(display); } refreshGeometry(); }
void TabsInkBar::setTweenValue(qreal value) { _tween = value; refreshGeometry(); }