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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user