israelCanul / rokon

Automatically exported from code.google.com/p/rokon
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

TextSprite without VBO's #90

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create and setup a TextSprite (using a ".ttf" font)
2. Set the game to not use VBO's 
(setDrawPriority(DrawPriority.PRIORITY_NORMAL);)

What is the expected output?
Seeing some text.

What do you see instead?
Nothing.

What version of Rokon are you using?
Trunk r344

On which version of Android are you experiencing this?
1.5 (Emulator) and 2.1 (Phone) (and probably everything else too)

Please provide any additional information below.
Simple problem, the text wont show up unless you use VBO's.

I also get this error every frame:

java.lang.NullPointerException
     at com.stickycoding.rokon.TextSprite.onDrawNormal(TextSprite.java:68)
     at com.stickycoding.rokon.DrawableObject.onDraw(DrawableObject.java:360)
     at com.stickycoding.rokon.Layer.onDraw(Layer.java:139)
     at com.stickycoding.rokon.Scene.onDraw(Scene.java:932)
     at com.stickycoding.rokon.RokonRenderer.onDrawFrame(RokonRenderer.java:52)
     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:955)
     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:887)

Original issue reported on code.google.com by anton.he...@gmail.com on 4 Jul 2010 at 10:07

GoogleCodeExporter commented 8 years ago
Thanks, I'll have a looksee

Original comment by rtaylor205@gmail.com on 5 Jul 2010 at 12:06

GoogleCodeExporter commented 8 years ago
Looks like you're adding it to the Scene when there's no text.

Which is fair enough, no reason why you shouldn't, but the engine just didn't 
like it!

It's fixed now :)

Original comment by rtaylor205@gmail.com on 5 Jul 2010 at 7:52

GoogleCodeExporter commented 8 years ago
Nope, still doesn't work.
Think you might have forgot to commit some files, because the only file you 
updated was DimensionalObject.java.

And just as a side note, it doesn't work even if you add setText() before you 
add it to the scene.
Dunno if I'm using it wrong or what, but this is what I have (and it still only 
works if you use VBO's)

font = new Font("arial.ttf");
scoreText = new TextSprite(10, 100, 10, 20); // Just some random numbers to see 
if it works
scoreText.setTexture(font.createTexture("Some Text"));
scoreText.setText("Test"); // This doesn't seem to do anything, because when it 
does work (when you use VBO's) it just writes "Some Text" and not "Test"
add(scoreText);

Oh, and is there a way to use the font already on the phone so you don't have 
to add one yourself?

Original comment by anton.he...@gmail.com on 5 Jul 2010 at 8:56