CardItem::CardItem(const Card *card) :Pixmap(card->getPixmapPath(), false), card(card), filtered_card(card), auto_back(true), frozen(false) { Q_ASSERT(card != NULL); suit_pixmap.load(QString("image/system/suit/%1.png").arg(card->getSuitString())); cardsuit_pixmap.load(QString("image/system/cardsuit/%1.png").arg(card->getSuitString())); number_pixmap.load(QString("image/system/%1/%2.png").arg(card->isBlack()?"black":"red").arg(card->getNumberString())); icon_pixmap.load(card->getIconPath()); setTransformOriginPoint(pixmap.width()/2, pixmap.height()/2); setToolTip(card->getDescription()); setAcceptHoverEvents(true); QPixmap frame_pixmap("image/system/frame/good.png"); frame = new QGraphicsPixmapItem(frame_pixmap, this); frame->setPos(-6, -6); frame->hide(); avatar = NULL; owner_pixmap = NULL; owner_text = new QGraphicsSimpleTextItem(this); QPen pen(Qt::black); pen.setWidthF(0.5); owner_text->setPen(pen); owner_text->setBrush(Qt::yellow); owner_text->hide(); }
void CardItem::setFrame(const QString &result){ QString path = QString("image/system/frame/%1.png").arg(result); QPixmap frame_pixmap(path); if(!frame_pixmap.isNull()){ frame->setPixmap(frame_pixmap); frame->show(); } }
void RedDrawable::frame_rect(const SpiceRect& area, rgb32_t color) { RedDrawable_p* dest = (RedDrawable_p*)get_opaque(); switch (dest->source.type) { case PIXELS_SOURCE_TYPE_X_DRAWABLE: frame_drawable(dest, area, color, _origin); break; case PIXELS_SOURCE_TYPE_PIXMAP: frame_pixmap(dest, area, color, _origin); break; default: THROW("invalid dest type %d", dest->source.type); } }
CardItem::CardItem(const Card *card) :Pixmap(card->getPixmapPath(), false), card(card), filtered_card(card), auto_back(true) { Q_ASSERT(card != NULL); suit_pixmap.load(QString("image/system/suit/%1.png").arg(card->getSuitString())); icon_pixmap.load(card->getIconPath()); setTransformOriginPoint(pixmap.width()/2, pixmap.height()/2); setToolTip(card->getDescription()); QPixmap frame_pixmap("image/system/frame/good.png"); frame = new QGraphicsPixmapItem(frame_pixmap, this); frame->setPos(-6, -6); frame->hide(); avatar = NULL; }