Crossfire Server, Branches 1.12
R18729
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
CREAnimationWidget.cpp
Go to the documentation of this file.
1
#include <Qt>
2
3
#include "
CREAnimationWidget.h
"
4
#include "
CREPixmap.h
"
5
6
CREAnimationWidget::CREAnimationWidget
(QWidget* parent) : QWidget(parent)
7
{
8
myStep
= 0;
9
setMinimumWidth(32);
10
setMinimumHeight(32);
11
}
12
13
void
CREAnimationWidget::setAnimation
(QList<int> faces)
14
{
15
myFaces
= faces;
16
myStep
= 0;
17
}
18
19
void
CREAnimationWidget::step
()
20
{
21
if
(
myFaces
.size() == 0)
22
return
;
23
24
myStep
++;
25
if
(
myStep
==
myFaces
.size())
26
myStep
= 0;
27
28
repaint();
29
}
30
31
void
CREAnimationWidget::paintEvent
(QPaintEvent*
/*event*/
)
32
{
33
if
(
myStep
>=
myFaces
.size())
34
return
;
35
36
QPainter painter(
this
);
37
CREPixmap::getIcon
(
myFaces
[
myStep
]).paint(&painter, 0, 0, 32, 32);
38
}
CREAnimationWidget::step
void step()
Definition:
CREAnimationWidget.cpp:19
CREAnimationWidget::myFaces
QList< int > myFaces
Definition:
CREAnimationWidget.h:20
CREAnimationWidget::setAnimation
void setAnimation(QList< int > faces)
Definition:
CREAnimationWidget.cpp:13
CREPixmap.h
CREAnimationWidget::paintEvent
virtual void paintEvent(QPaintEvent *event)
Definition:
CREAnimationWidget.cpp:31
CREAnimationWidget::myStep
int myStep
Definition:
CREAnimationWidget.h:19
CREAnimationWidget::CREAnimationWidget
CREAnimationWidget(QWidget *parent)
Definition:
CREAnimationWidget.cpp:6
CREPixmap::getIcon
static QIcon getIcon(int faceNumber)
Definition:
CREPixmap.cpp:27
CREAnimationWidget.h
crossfire-code
server
branches
1.12
utils
cre
CREAnimationWidget.cpp
Generated on Sun Nov 18 2018 02:40:30 for Crossfire Server, Branches 1.12 by
1.8.6