Sorry guys, i hate to ask this but can not find much documentation or example of this.
I making game and need develop de HUD, render some text with some font format (TTF file for example).
But i can not find an not deprecated example :'(
I hope someone can help me.
Stackoverflow question: http://stackoverflow.com/questions/36684285/render-text-with-lwjgl-and-ttf-file
Sorry if it is a duplicated question, but I found the solution.
Thanx!
Attached a actual photo of my game =)
Regards!
See the Truetype demos here (https://github.com/LWJGL/lwjgl3/tree/master/modules/core/src/test/java/org/lwjgl/demo/stb). They demonstrate TTF rendering using stb_truetype from the stb (https://github.com/nothings/stb) library.
I tried but I have this error at compile :-\
Exception in thread "main" java.lang.NoSuchMethodError: org.lwjgl.system.MemoryUtil.memUTF8(Ljava/nio/ByteBuffer;)Ljava/lang/String;
at org.lwjgl.demo.stb.FontDemo.<init>(FontDemo.java:59)
at org.lwjgl.demo.stb.Truetype.<init>(Truetype.java:26)
at org.lwjgl.demo.stb.Truetype.main(Truetype.java:37)
And this errors on code:
Line 42: STBTTBakedChar.Buffer cdata = STBTTBakedChar.malloc(96); // Maybe can change it for mallocBuffer(int)?
Line 106: STBTTAlignedQuad q = STBTTAlignedQuad.mallocStack(stack); // ??
Demos in the LWJGL repository require the latest nightly build (https://www.lwjgl.org/download) to compile and run.
:o :o :o :o :o :o
it's works!
Thanks!!
:-[