Change which events are transparent
This commit is contained in:
parent
668c0b65ac
commit
fde8a694aa
4 changed files with 5 additions and 1 deletions
|
@ -79,6 +79,7 @@ public:
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
int spriteWidth;
|
int spriteWidth;
|
||||||
int spriteHeight;
|
int spriteHeight;
|
||||||
|
bool usingSprite;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // EVENT_H
|
#endif // EVENT_H
|
||||||
|
|
|
@ -14,6 +14,7 @@ Event::Event()
|
||||||
{
|
{
|
||||||
this->spriteWidth = 16;
|
this->spriteWidth = 16;
|
||||||
this->spriteHeight = 16;
|
this->spriteHeight = 16;
|
||||||
|
this->usingSprite = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Event* Event::createNewEvent(QString event_type, QString map_name)
|
Event* Event::createNewEvent(QString event_type, QString map_name)
|
||||||
|
@ -242,4 +243,5 @@ void Event::setPixmapFromSpritesheet(QImage spritesheet, int spriteWidth, int sp
|
||||||
pixmap = QPixmap::fromImage(img);
|
pixmap = QPixmap::fromImage(img);
|
||||||
this->spriteWidth = spriteWidth;
|
this->spriteWidth = spriteWidth;
|
||||||
this->spriteHeight = spriteHeight;
|
this->spriteHeight = spriteHeight;
|
||||||
|
this->usingSprite = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -711,7 +711,7 @@ void Editor::displayMapEvents() {
|
||||||
|
|
||||||
DraggablePixmapItem *Editor::addMapEvent(Event *event) {
|
DraggablePixmapItem *Editor::addMapEvent(Event *event) {
|
||||||
DraggablePixmapItem *object = new DraggablePixmapItem(event, this);
|
DraggablePixmapItem *object = new DraggablePixmapItem(event, this);
|
||||||
if (event->get("event_type") != EventType::Object) {
|
if (!event->usingSprite) {
|
||||||
object->setOpacity(0.7);
|
object->setOpacity(0.7);
|
||||||
}
|
}
|
||||||
events_group->addToGroup(object);
|
events_group->addToGroup(object);
|
||||||
|
|
|
@ -1616,6 +1616,7 @@ void Project::loadEventPixmaps(QList<Event*> objects) {
|
||||||
|
|
||||||
object->spriteWidth = 16;
|
object->spriteWidth = 16;
|
||||||
object->spriteHeight = 16;
|
object->spriteHeight = 16;
|
||||||
|
object->usingSprite = false;
|
||||||
QString event_type = object->get("event_type");
|
QString event_type = object->get("event_type");
|
||||||
if (event_type == EventType::Object) {
|
if (event_type == EventType::Object) {
|
||||||
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(0, 0, 16, 16);
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(0, 0, 16, 16);
|
||||||
|
|
Loading…
Reference in a new issue