text background (30 posts)

Topic tags: background, text
  • Profile picture of phantomliger11 phantomliger11-6p said 3 months, 3 weeks ago:

    Is there a way to have BitmapText to have a background? or some sort of text to have a background?

  • Profile picture of pspeed pspeed815p said 3 months, 3 weeks ago:

    BitmapText plus a Quad that is sized to the text.

  • Profile picture of phantomliger11 phantomliger11-6p said 3 months, 3 weeks ago:

    so i could use getlineheight and getlinewidth correct?

  • Profile picture of Tr3kk3r Tr3kk3r2p said 3 months, 3 weeks ago:

    @phantomliger11 said:
    so i could use getlineheight and getlinewidth correct?

    Yes.

    If the string displayeyd on your Bitmaptext changes, simply also update the quad to the new size of your BitmapText.

  • Profile picture of phantomliger11 phantomliger11-6p said 3 months, 3 weeks ago:

    So how do I set its position, because it doesnt seem to have any function for that?…im a tad confused by that.

  • Profile picture of Tr3kk3r Tr3kk3r2p said 3 months, 3 weeks ago:

    As you do with all spatials: setLocalTranslation().

  • Profile picture of pspeed pspeed815p said 3 months, 3 weeks ago:

    Which “it” do you mean in this case? The Quad has to be put in a Geometry or you can’t even add it to the scene. And you can put the Geometry anywhere you want.

  • Profile picture of phantomliger11 phantomliger11-6p said 3 months, 3 weeks ago:

    ooo. ok. i didnt realize it needed to be in a geometry. ill try that.

  • Profile picture of normen normen1290p said 3 months, 3 weeks ago:

    http://jmonkeyengine.org/wiki/doku.php/jme3:scenegraph_for_dummies any1? :D

  • Profile picture of phantomliger11 phantomliger11-6p said 3 months, 2 weeks ago:

    Ok. Is there any other way to have a background to Bitmaptext that is actually on the screen? instead of in the game world, or can i put the text (which are numbers just for clarification) into the game world instead of on the screen?

    And i dont think that scenegraph for dummies would really help with the situation. i knew everything that was in there. it was just one of those dumb moments where i didnt see that i needed the quad to be attached to a geometry so i didnt know it.

  • Profile picture of normen normen1290p said 3 months, 2 weeks ago:

    @phantomliger11 said:
    And i dont think that scenegraph for dummies would really help with the situation. i knew everything that was in there.

    @phantomliger11 said:
    Ok. Is there any other way to have a background to Bitmaptext that is actually on the screen? instead of in the game world, or can i put the text (which are numbers just for clarification) into the game world instead of on the screen?

    You could do that but for readability you should probably use cam.worldToScreen() to move them on the screen in the gui node instead.

  • Profile picture of pspeed pspeed815p said 3 months, 2 weeks ago:

    @phantomliger11 said:
    Ok. Is there any other way to have a background to Bitmaptext that is actually on the screen? instead of in the game world, or can i put the text (which are numbers just for clarification) into the game world instead of on the screen?

    There is no difference between things in the gui and things in the world except what root node you attach them to.

    Or one of us is completely misunderstanding the other.

  • Profile picture of phantomliger11 phantomliger11-6p said 3 months, 2 weeks ago:

    that depends on if worldToScreen() is a function in beta. because i am currently using the alpha 4 version because it crashes in the beat one. which i am trying to fix also. and apparently beta doesnt have cam.setDirection() anymore because it says it doesnt exist on the line that I use that.

    I just felt it would be easier for them to be in the game world so I wouldnt have to worry about moving them around on the screen according to where objects are. unless that is made really easy in the beta.

    and i guess that does make sense for the dummies page there but the bitmaptext isnt a geometry and it is visible. haha.

  • Profile picture of normen normen1290p said 3 months, 2 weeks ago:

    Oh yes, bitmaptext is a geometry, multiple even with a quad mesh for each letter. worldToScreen() and setDirection() have not changed between alpha and beta, unless you use them wrong, then anything could happen really ^^

  • Profile picture of phantomliger11 phantomliger11-6p said 3 months, 2 weeks ago:

    well in the alpha, it says worldToScreen doesnt exist. it says cannot find method worldToScreen