Improved Vertical Scrolling

This commit is contained in:
techdragon.nguyen@gmail.com
2010-11-28 23:54:36 +00:00
parent 3205ebdc8b
commit 8fd35ac513
7 changed files with 70 additions and 47 deletions

View File

@@ -41,11 +41,11 @@ private:
size_t mNbItemsShown;
bool mScrollerInitialized;
float mHeight; // maximum height availble for display
int mMarginX;
int mMarginY; // margin used to allow text to scroll off screen without
float mMarginX;
float mMarginY; // 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)
float mVerticalScrollSpeed;
// for at least one line of text ( mY - line height of current font )
float mOriginalY; // mY initially, used to restore scroller to original position after update
protected:
string wordWrap(string sentence, float width);
@@ -54,6 +54,6 @@ 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);
void Add(string text);
};
#endif