implemented vertical scrolling.
created new class VerticalTextScroller to handle task display in deck selection screens modified detailed popup placement on deck selection screen to compensate for lack of border
This commit is contained in:
@@ -12,27 +12,47 @@ protected:
|
||||
string mText;
|
||||
string tempText;
|
||||
int fontId;
|
||||
float mWidth;
|
||||
float mSpeed;
|
||||
float mWidth; // width of the text scroller object
|
||||
float mScrollSpeed;
|
||||
float mX;
|
||||
float mY;
|
||||
float start;
|
||||
int timer;
|
||||
size_t minimumItems;
|
||||
|
||||
|
||||
vector<string> strings;
|
||||
unsigned int currentId;
|
||||
int mRandom;
|
||||
int scrollDirection;
|
||||
|
||||
public:
|
||||
TextScroller(int fontId, float x, float y, float width, float speed = 100);
|
||||
void Add(string text);
|
||||
void Reset();
|
||||
void setRandom(int mode = 1);
|
||||
TextScroller(int fontId, float x, float y, float width, float speed = 30, int scrollerType = 0, size_t _minimumItems = 2);
|
||||
void Render();
|
||||
void Update(float dt);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
};
|
||||
|
||||
class VerticalTextScroller:
|
||||
public TextScroller
|
||||
{
|
||||
private:
|
||||
size_t mNbItemsShown;
|
||||
bool mScrollerInitialized;
|
||||
float mHeight; // maximum height availble for display
|
||||
int marginX;
|
||||
int marginY; // margin used to allow text to scroll off screen without
|
||||
// affecting look and feel. Should be enough
|
||||
// for at least one line of text ( marginY)
|
||||
|
||||
protected:
|
||||
string wordWrap(string sentence, float width);
|
||||
|
||||
public:
|
||||
VerticalTextScroller(int fontId, float x, float y, float width, float height, float scrollSpeed = 30, size_t _minimumItems = 1);
|
||||
void Render();
|
||||
void Update(float dt);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user