Added first draft of an interactive button. Needs to handle addition of images a little better

refined detailed info window for stats display
removed PSP button for Touch interfaces (currently only iOS and Android) on deck selection screens
to not break the core engine and reduce some more complex code, I created a new vector in the JController object. mButtons.  This vector will contain all the valid buttons for a given screen.  The appropriate Add/Remove methods have been updated to account for this new vector.
This commit is contained in:
techdragon.nguyen@gmail.com
2012-01-25 18:35:24 +00:00
parent 59fad775c8
commit a36d886dd5
16 changed files with 523 additions and 232 deletions

View File

@@ -4,6 +4,7 @@
#include <string>
#include <JLBFont.h>
#include <JGui.h>
#include "SimpleButton.h"
#include "SimpleMenu.h"
using std::string;
@@ -11,65 +12,20 @@ using std::string;
#define SCALE_SELECTED 1.2f
#define SCALE_NORMAL 1.0f
class SimpleMenuItem: public JGuiObject
class SimpleMenuItem: public SimpleButton
{
private:
SimpleMenu* parent;
float mScale;
float mTargetScale;
bool mHasFocus;
bool mIsValidSelection;
float mX;
float mY;
protected:
int mFontId;
string mText;
static float mYOffset;
float mXOffset;
string mDescription;
public:
SimpleMenuItem(int id);
SimpleMenuItem(SimpleMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false);
virtual int getFontId() const;
virtual void setFontId( const int& fontId );
virtual void setX( const float& x ) { mX = x; };
virtual void setY( const float& y ) { mY = y; };
virtual void setIsSelectionValid( bool validSelection );
virtual void setFocus(bool value);
virtual void setDescription( const string& desc );
virtual void setText( const string& text);
virtual bool isSelectionValid() const;
virtual bool hasFocus() const;
virtual string getDescription() const;
virtual string getText() const;
float getX() const;
float getY() const;
virtual void checkUserClick();
virtual float GetWidth() const;
virtual void Relocate(float x, float y);
virtual void RenderWithOffset(float yOffset);
virtual void Render();
virtual void Update(float dt);
virtual void Entering();
virtual bool Leaving(JButton key);
virtual bool ButtonPressed();
virtual void setDescription( const string& desc );
virtual string getDescription() const;
virtual ostream& toString(ostream& out) const;
virtual bool getTopLeft(float& top, float& left)
{
top = mY + mYOffset;
left = mX;
return true;
}
;
};
#endif