• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kgoldrunner

  • sources
  • kde-4.14
  • kdegames
  • kgoldrunner
  • src
kgrsprite.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright 2006 Mauricio Piacentini <mauricio@tabuleiro.com> *
3  * Copyright 2009 Ian Wadham <iandw.au@gmail.com> *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ****************************************************************************/
18 
19 #ifndef KGRSPRITE_H
20 #define KGRSPRITE_H
21 
22 #include <QPixmap>
23 #include <QList>
24 
25 #include <KGameRenderedItem>
26 
27 class KGrRenderer;
28 
29 class KGrSprite : public KGameRenderedItem
30 {
31 public:
32  explicit KGrSprite (KGameRenderer * renderer, QString & key,
33  const char type, const int tickTime = 20);
34  ~KGrSprite();
35 
36  inline char spriteType () { return m_type; }
37  inline QPointF currentLoc () { return QPointF (m_x, m_y); }
38  inline int currentFrame () { return frame(); }
39  inline void setZ (qreal z) { setZValue(z); }
40 
41  void move (double x, double y, int frame);
42  void animate (bool missed);
43  void setAnimation (bool repeating, int x, int y, int startFrame,
44  int nFrames, int dx, int dy, int dt,
45  int nFrameChanges);
46  void setCoordinateSystem (int topLeftX, int topLeftY, int tileSize);
47  void changeCoordinateSystem (int topLeftX, int topLeftY, int tileSize);
48 
49 private:
50  char m_type;
51  char m_tickTime;
52  bool m_stationary;
53  bool m_repeating;
54  double m_x;
55  double m_y;
56  int m_startFrame;
57  int m_nFrames;
58  int m_frameCtr;
59  double m_dx;
60  double m_dy;
61  int m_dt;
62  int m_nFrameChanges;
63  int m_ticks;
64  double m_frameTicks;
65  double m_frameChange;
66  double m_oldX;
67  double m_oldY;
68  int m_oldFrame;
69 
70  int m_topLeftX;
71  int m_topLeftY;
72  int m_tileSize;
73 };
74 
75 #endif // KGRSPRITE_H
KGrSprite::~KGrSprite
~KGrSprite()
Definition: kgrsprite.cpp:49
QPointF
KGrSprite::setCoordinateSystem
void setCoordinateSystem(int topLeftX, int topLeftY, int tileSize)
Definition: kgrsprite.cpp:120
QString
KGrSprite::KGrSprite
KGrSprite(KGameRenderer *renderer, QString &key, const char type, const int tickTime=20)
Definition: kgrsprite.cpp:24
KGrRenderer
Definition: kgrrenderer.h:61
KGrSprite::setAnimation
void setAnimation(bool repeating, int x, int y, int startFrame, int nFrames, int dx, int dy, int dt, int nFrameChanges)
Definition: kgrsprite.cpp:70
KGrSprite::move
void move(double x, double y, int frame)
Definition: kgrsprite.cpp:53
KGrSprite::spriteType
char spriteType()
Definition: kgrsprite.h:36
KGrSprite
Definition: kgrsprite.h:29
KGameRenderedItem
KGrSprite::currentLoc
QPointF currentLoc()
Definition: kgrsprite.h:37
KGrSprite::currentFrame
int currentFrame()
Definition: kgrsprite.h:38
KGrSprite::setZ
void setZ(qreal z)
Definition: kgrsprite.h:39
KGrSprite::animate
void animate(bool missed)
Definition: kgrsprite.cpp:91
KGrSprite::changeCoordinateSystem
void changeCoordinateSystem(int topLeftX, int topLeftY, int tileSize)
Definition: kgrsprite.cpp:130
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgoldrunner

Skip menu "kgoldrunner"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal