I load an image (which is really a flat egg model):
image = loader.loadModel( "image" )
image.setPos(x,y,z)
image.setScale(x,y,z)
image.reparentTo( aspect2d )
image.setBin("fixed", 40) # btw, why 40?
And then I load text on it:
text = TextNode("node name")
# load a text file to read from
textfile = open('textfile.txt')
text.setText(textfile.read())
textNodePath = aspect2d.attachNewNode(text)
textNodePath.setScale(x)
textNodePath.setPos(x,y,z)
text.setTextColor(0,0,0,1)
# wordwrap
text.setWordwrap(16)
Now it looks pretty cool and all with so little coding.
But I need a way to count the lines (generated by wordwrap) somehow, so the text wont go all over the screen,I will be able to load it like 4 lines each time. How can I count the lines?