PDA

View Full Version : Help with scrolling textbox entity - Android



darkchazz
08-14-2013, 09:07 AM
Not sure what I'm doing wrong here... but the included ScrollingTextBoxEntity is supposed to use the "RenderScissorComponent" so the text does not get drawn outside the scroll box. Except my text always scrolls through the whole display no matter what scroll box boundaries I set....

Here is my code:

Entity *TextEntity;
float x = 50;
float y = 40;

CL_Vec2f vTextAreaPos(x,y);
CL_Vec2f vTextAreaBounds(GetScreenSizeX()-100,GetScreenSizeY()-130);

string msg = ".........";

TextEntity = CreateScrollingTextBoxEntity(BG, "TheCredits", vTextAreaPos, vTextAreaBounds, msg);
Can anyone test the entity and see if it works correctly for them?
I'm using the latest android sdk and ndk.

Seth
08-16-2013, 02:01 AM
Not sure what I'm doing wrong here... but the included ScrollingTextBoxEntity is supposed to use the "RenderScissorComponent" so the text does not get drawn outside the scroll box. Except my text always scrolls through the whole display no matter what scroll box boundaries I set....

Here is my code:

Entity *TextEntity;
float x = 50;
float y = 40;

CL_Vec2f vTextAreaPos(x,y);
CL_Vec2f vTextAreaBounds(GetScreenSizeX()-100,GetScreenSizeY()-130);

string msg = ".........";

TextEntity = CreateScrollingTextBoxEntity(BG, "TheCredits", vTextAreaPos, vTextAreaBounds, msg);
Can anyone test the entity and see if it works correctly for them?
I'm using the latest android sdk and ndk.

Does the RTSimpleApp example's scrolling text work correctly?

Does the same code work correctly in the Windows build?

darkchazz
08-16-2013, 02:32 AM
Does the RTSimpleApp example's scrolling text work correctly?

Does the same code work correctly in the Windows build?

Haven't compiled my project for windows. But I just tried RTSimpleApp on my device and yes it does work correctly.

I noticed in the rtsimpleapp sources that you setup everything manually instead of using the entity mentioned. I think I'll try to do it your way

EDIT: I should also mention that the ScrollingTextBoxEntity does not show the scroll bar for some reason, in addition to what I've mentioned in the OP.



EDIT #2: I don't understand... I've set up the scroll box in my app exactly like the example does yet I get the same issue as before.. But it works fine in the example itself.
I even tried using the exact same code in the OP in the example and it WORKS, but it my own app I get the issues mentioned: text is drawn past the boundaries, and no scroll bar.

EDIT #3: Fixed!
My project was missing the scroll_bar_caps image. Can't believe I've missed that :(