Erwan
- fix issue 215 - added test for purple screen (this is the small white square on top of the loading screen)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include "../include/TextScroller.h"
|
||||
#include "../include/WResourceManager.h"
|
||||
#include "../include/utils.h"
|
||||
#include <JLBFont.h>
|
||||
|
||||
TextScroller::TextScroller(JLBFont * font, float x, float y, float width, float speed):JGuiObject(0){
|
||||
mFont = font;
|
||||
TextScroller::TextScroller(int fontId, float x, float y, float width, float speed):JGuiObject(0),fontId(fontId){
|
||||
mWidth = width;
|
||||
mSpeed = speed;
|
||||
mX = x;
|
||||
@@ -35,6 +35,7 @@ void TextScroller::Update(float dt){
|
||||
if(!strings.size())
|
||||
return;
|
||||
start+=mSpeed*dt;
|
||||
JLBFont * mFont = resources.GetJLBFont(fontId);
|
||||
if (start > mFont->GetStringWidth(mText.c_str())){
|
||||
start = -mWidth;
|
||||
if (mRandom){
|
||||
@@ -49,6 +50,7 @@ void TextScroller::Update(float dt){
|
||||
}
|
||||
|
||||
void TextScroller::Render(){
|
||||
JLBFont * mFont = resources.GetJLBFont(fontId);
|
||||
mFont->DrawString(mText.c_str(),mX,mY,JGETEXT_LEFT,start,mWidth);
|
||||
}
|
||||
|
||||
@@ -56,7 +58,6 @@ ostream& TextScroller::toString(ostream& out) const
|
||||
{
|
||||
return out << "TextScroller ::: mText : " << mText
|
||||
<< " ; tempText : " << tempText
|
||||
<< " ; mFont : " << mFont
|
||||
<< " ; mWidth : " << mWidth
|
||||
<< " ; mSpeed : " << mSpeed
|
||||
<< " ; mX,mY : " << mX << "," << mY
|
||||
|
||||
Reference in New Issue
Block a user