Example #1
0
void QGraphicsCharaItem::setBasePix(const QString &n_pixName)
{
    m_pix = QPixmap(mCore->filePath(CHARSET,n_pixName));
    if (m_pix.isNull())
        m_pix = QPixmap(mCore->rtpPath(CHARSET,n_pixName));
    updatePix();
}
Example #2
0
NumAnimWidget::NumAnimWidget(QWidget *parent) :
    QWidget(parent), m_isInit(true), m_isStart(false), m_isEnd(false)
{
    m_timer = new QTimer(this);
    m_timer->setInterval(10);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(updatePix()));
    this->setAttribute(Qt::WA_TranslucentBackground);
}
Example #3
0
void QGraphicsCharaItem::setBasePix(const QString &n_pixName)
{
	m_pix.reset(new QPixmap(mCore->filePath(CHARSET,n_pixName)));
	if (m_pix->isNull())
		m_pix.reset(new QPixmap(mCore->rtpPath(CHARSET,n_pixName)));
	if (m_pix->isNull())
		m_pix.reset(mCore->createDummyPixmap(288,256));
	updatePix();
}
void QGraphicsBattleAnimationItem::on_demoAdvance()
{
    if (!m_demo)
        return;
    m_demoIndex++;
    if (m_demoIndex > 11)
        m_demoIndex = 0;
    RPG::BattlerAnimationExtension anim = m_demoAnimation.base_data[m_demoIndex];
    setBasePix(Battler, QString::fromStdString(anim.battler_name));
    m_index = anim.battler_index;
    updatePix();
}
void QGraphicsBattleAnimationItem::advance(int phase)
{
    static int frame_count = 0;
    static int patterns[4] = {1, 0, 1, 2}; /* Mid, Left, Mid, Right*/
    if (!phase)
    {
        frame_count++;
        m_frame = patterns[frame_count%4];
        if (frame_count >= 16)
        {
            frame_count = 0;
            emit demoAdvance();
        }
    }
    else
        updatePix();
}
void QGraphicsBattleAnimationItem::setBasePix(Type type, const QString &pixName)
{
    m_type = type;
    if (pixName.isEmpty())
    {
        m_pix = QPixmap(144,384);
        m_pix.fill(Qt::black);
    }
    else
    {
        QString dir;
        if (type == Weapon)
            dir = BATTLEWEAPON;
        else
            dir = BATTLECHARSET;
        m_pix = QPixmap(mCore->filePath(dir, pixName));
        if (m_pix.isNull())
            m_pix = QPixmap(mCore->rtpPath(dir, pixName));
    }
    updatePix();
}
Example #7
0
void QGraphicsCharaItem::advance(int phase)
{
    static int patterns[4] = {Frame_middle, Frame_right, Frame_middle,Frame_left};
    if (!phase)
    {

        frame_count++;
        if (frame_count == 20)
        {
            frame_count = 0;
            if (m_spin)
            {
                m_facing++;
                if (m_facing > Direction_left)
                    m_facing = Direction_up;
            }
        }
        if (m_walk)
            m_frame = patterns[frame_count%4];
    }
    else
        updatePix();
}
Example #8
0
void QGraphicsCharaItem::setFrame(int frame)
{
    m_frame = frame;
    updatePix();
}
Example #9
0
void QGraphicsCharaItem::setFacing(int facing)
{
    m_facing = facing;
    updatePix();
}
Example #10
0
void QGraphicsCharaItem::setIndex(int index)
{
    m_index = index;
    updatePix();
}
void QGraphicsBattleAnimationItem::setIndex(int index)
{
    m_index = index;
    updatePix();
}