Integer Text location

Hi !!



I need Texts to be positionned with float coordinates to prevent them jumping from pixels to pixels, but current implementation do not allow this (And overriding the Renderer/Font classes to do this is awfull and not of any help because of private members).



The easy way to do this would be to change the print method of the Font (LWJGL and JOGL) class to take floats instead of integers :

    - from : public void print(LWJGLRenderer r, int x, int y, Vector3f scale, StringBuffer text, int set) {

    - to : public void print(LWJGLRenderer r, float x, float y, Vector3f scale, StringBuffer text, int set) {



And to change the call to this method in the Renderer (LWJGL and JOGL) :

    - from : font.print(this, (int) t.getWorldTranslation().x, (int) t.getWorldTranslation().y, t.getWorldScale(), t.getText(), 0);

    - to : font.print(this, t.getWorldTranslation().x, t.getWorldTranslation().y, t.getWorldScale(), t.getText(), 0);



This way the programmer has the possiblity to choose the way Texts are located on the screen. (Note that in current implementation, a Math.round would be better than the cast that is currently done, jumps being then less visible).



Do you see any problem with this ?

I don't think this is unreasonable.  Anyone else?

Hi

Nobody against that? So could you change the code?

:smiley:

thanks renanse

:’( :’( :’( :’(

please

Heh, sure.  I just like to give enough time for comments.

up in svn.

Thanks super-renanse. :smiley: