Files
wagic/projects/mtg/include/IconButton.h
Xawotihs f68c106e7e - Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).
- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it.
- Various cleanup/refactor of the game observer.
- Added a gameObserver == operator to compare two games
- Added player mode to the player serialization
- Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1.
- Refactored random generator class to use list intead of queue
- Defined a specific type for interrupt decision instead of int
2011-11-13 22:36:34 +00:00

51 lines
1.4 KiB
C++

#ifndef _ICONBUTTON_H
#define _ICONBUTTON_H
#include <string>
#include <JGui.h>
using std::string;
class IconButtonsController: public JGuiController, public JGuiListener
{
public:
float mX;
float mY;
IconButtonsController(JGE* jge, float x, float y);
void SetColor(PIXEL_TYPE color);
};
class IconButton: public JGuiObject
{
private:
PIXEL_TYPE mColor;
IconButtonsController * mParent;
bool mHasFocus;
int mFontId;
string mText;
float mScale, mCurrentScale, mTargetScale;
float mX, mY;
float mTextRelativeX, mTextRelativeY;
JTexture * mTex;
JQuad * mQuad;
public:
IconButton(int id, IconButtonsController * parent, string texture, float x, float y, float scale, int fontId, string text, float textRelativeX, float textRelativeY, bool hasFocus = false);
IconButton(int id, IconButtonsController * parent, JQuad * quad, float x, float y, float scale, int fontId, string text, float textRelativeX, float textRelativeY, bool hasFocus = false);
void init(IconButtonsController * parent, JQuad * quad, float x, float y, float scale, int fontId, string text, float textRelativeX, float textRelativeY, bool hasFocus);
~IconButton();
ostream& toString(ostream& out) const;
bool hasFocus();
virtual void Render();
virtual void Update(float dt);
virtual void Entering();
virtual bool Leaving(JButton key);
virtual bool ButtonPressed();
void SetColor(PIXEL_TYPE color);
};
#endif