Hello again…
I’ve played around with the “huds for the total noob” tutorial, especially
the last section using Java2D.
I want to draw a text (rendered by java2d). This works but everything is inverted.
screenshot
Hmm, something with the coordinate system (my noobish guess…)
“TextureManager” has a “flip” parameter in the constructor… fine, but I don’t use TextureManager if I use Java2D.
This is the “paint” method of my class “StartMenu”:
g.setBackground (new Color (0f, 0f, 0f, 0f));
g.clearRect (0, 0, getWidth (), getHeight ());
font = new Font("SansSerif", Font.PLAIN, 36 );
g.setFont (font);
g.setColor (new Color (0f, 1f, 0f, 1f));
g.drawString ("1 = Neu starten", 20, 20);
g.drawString ("2 = Ende", 20, 56);
(Yeah, in German... "1 = start", "2 = end", that simple..)
This is the part where i "load" my texture in the game (... where I get the
image data from my "StartMenu" class generated via Java2D.
startMenu = new StartMenu();
Texture texture = new Texture();
texture.setApply(Texture.AM_MODULATE);
texture.setBlendColor(new ColorRGBA(1, 1, 1, 1));
texture.setFilter(Texture.MM_LINEAR);
texture.setImage(startMenu);
texture.setMipmapState(Texture.FM_LINEAR);
infoQuad_ts = display.getRenderer().createTextureState();
infoQuad_ts.setTexture(texture);
// infoQuad_ts.setCorrection(TextureState.CM_PERSPECTIVE);
infoQuad_ts.setEnabled(true);
infoQuad.setRenderState(infoQuad_ts);
infoQuad.updateRenderState();
Any input?
I've read some stuff about "affine transformations" in Java2d, but every example is about
rotating, scaling, sheering and stuff... but a coordinate system conversion.. hmmm..
Thanks in advance..