本文整理汇总了Java中com.jme3.font.BitmapText.setQueueBucket方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapText.setQueueBucket方法的具体用法?Java BitmapText.setQueueBucket怎么用?Java BitmapText.setQueueBucket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.font.BitmapText
的用法示例。
在下文中一共展示了BitmapText.setQueueBucket方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleInitApp
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Quad q = new Quad(6, 3);
Geometry g = new Geometry("quad", q);
g.setLocalTranslation(0, -3, -0.0001f);
g.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(g);
BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText txt = new BitmapText(fnt, false);
txt.setBox(new Rectangle(0, 0, 6, 3));
txt.setQueueBucket(Bucket.Transparent);
txt.setSize( 0.5f );
txt.setText(txtB);
rootNode.attachChild(txt);
}
示例2: createBillboard
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
public void createBillboard(AssetManager manager) {
// Set position above model
// Load font and create the Text
BitmapFont font = manager.loadFont("Interface/Fonts/Default.fnt");
BitmapText bmText = new BitmapText(font);
bmText.setSize(0.25f);
bmText.setText(actorName);
bmText.setQueueBucket(Bucket.Transparent);
bmText.setColor(ColorRGBA.Orange);
bmText.setBox(new Rectangle(-bmText.getLineWidth() / 2.0f - 0.2f, 0, bmText.getLineWidth() * 2.0f, bmText.getLineHeight() + 0.1f));
bmText.setAlignment(BitmapFont.Align.Left);
bmText.setLineWrapMode(LineWrapMode.NoWrap);
Vector3f newPos = new Vector3f(0, 2.5f, 0);
// Create node and add a BillboardControl so it rotates with the cam
BillboardControl bbControl = new BillboardControl();
bbControl.setAlignment(BillboardControl.Alignment.Screen);
Node textNode = new Node("Node for text");
textNode.setLocalTranslation(newPos);
textNode.setCullHint(CullHint.Never);
textNode.attachChild(bmText);
bmText.addControl(bbControl);
//Vector3f world = textNode.getWorldTranslation();
this.attachChild(textNode);
//System.out.println("Text node location for " + actorName + "," +world);
}
示例3: create
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void create( AssetManager manager, String extraInfo) {
// Load font and create the Text
font = manager.loadFont("Font/billboard.fnt");
bmText = new BitmapText(font, true);
bmText.setSize(0.5f);
bmText.setText(text);
bmText.setQueueBucket(RenderQueue.Bucket.Transparent);
bmText.setColor(fontColor);
this.attachChild(bmText);
this.setShadowMode(shadowMode.Off);
}
示例4: createPlayerName
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
private void createPlayerName(String name, int teamId) {
BitmapText text = new BitmapText(guiFont);
text.setSize(guiFont.getCharSet().getRenderedSize() * 0.8f);
text.setBox(new Rectangle(0, 0, 80, 10));
text.setText(name);
text.setColor(TEAM_COLORS[teamId].clone());
text.setAlignment(BitmapFont.Align.Center);
text.center();
guiNode.attachChild(text);
text.setQueueBucket(RenderQueue.Bucket.Gui);
playerNames.add(text);
}