本文整理汇总了Java中com.jme3.font.BitmapText.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapText.setColor方法的具体用法?Java BitmapText.setColor怎么用?Java BitmapText.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.font.BitmapText
的用法示例。
在下文中一共展示了BitmapText.setColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.app = app;
chunksNode.updateGeometricState();
app.getViewPort().attachScene(chunksNode);
active = true;
new TraceableThread(this::loadChunks, "chunk-loader").start();
new TraceableThread(this::meshChunks, "chunk-mesher").start();
BitmapFont font = app.getAssetManager().loadFont("Interface/Fonts/Console.fnt");
debugText = new BitmapText(font);
debugText.setSize(font.getCharSet().getRenderedSize());
debugText.setColor(ColorRGBA.White);
debugText.setText("");
debugText.setLocalTranslation(0.0f, 0.0f, 1.0f);
debugText.updateGeometricState();
((SimpleApplication)app).getGuiNode().attachChild(debugText);
}
示例2: initCrossHairs
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
/** A centred plus sign to help the player aim. */
protected void initCrossHairs() {
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize()*1.5f);
ch.setText("+"); // crosshairs
ch.setLocalTranslation( // center
settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2,
settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
guiNode.attachChild(ch);
BitmapText ch2 = new BitmapText(guiFont, false);
ch2.setSize(guiFont.getCharSet().getRenderedSize());
ch2.setText("WASD, QE, ZX, RF - Camera Controls");
ch2.setColor(new ColorRGBA(1f,0.8f,0.1f,1f));
ch2.setLocalTranslation(settings.getWidth()*0.3f,settings.getHeight()*0.1f,0);
guiNode.attachChild(ch2);
}
示例3: initCrossHairs
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
protected void initCrossHairs() {
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize() * 2);
ch.setText("+"); // crosshairs
ch.setLocalTranslation( // center
settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2,
settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
guiNode.attachChild(ch);
BitmapText ch2 = new BitmapText(guiFont, false);
ch2.setSize(guiFont.getCharSet().getRenderedSize());
ch2.setText("Click to select");
ch2.setColor(new ColorRGBA(1f, 0.8f, 0.1f, 1f));
ch2.setLocalTranslation(settings.getWidth() * 0.3f, settings.getHeight() * 0.1f, 0);
guiNode.attachChild(ch2);
}
示例4: AimingControl
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
public AimingControl(SimpleApplication app, Node player) {
this.app = app;
asm = this.app.getAssetManager();
cam = app.getCamera();
this.player = player;
list = new LinkedList<Spatial>();
timer = 0f;
centerCam = new Vector2f(cam.getWidth() / 2, cam.getHeight() / 2);
distanceToRemove = 300f;
BitmapFont guiFont = asm.loadFont("Interface/Fonts/Default.fnt");
ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setColor(new ColorRGBA(1f, 0.35f, 0.1f, 0.8f));
}
示例5: Text
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
public Text(String text, ColorRGBA color) {
bitmapText = new BitmapText(UIFactory.getUIConfig().getFont());
bitmapText.setSize(UIFactory.getUIConfig().getBodyFontSize());
bitmapText.setText(text);
if (color != null) {
bitmapText.setColor(color);
}
this.width = bitmapText.getLineWidth();
this.height = bitmapText.getHeight();
attachChild(bitmapText);
setNeedUpdate();
}
示例6: onEntityAdded
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
protected void onEntityAdded(Entity e) {
FloatingLabel label = e.get(FloatingLabel.class);
BitmapText bt = new BitmapText(font);
bt.setText(label.getLabel());
bt.setColor(TranslateUtil.toColorRGBA(label.getColor()));
bt.setSize((float)label.getSize());
//bt.addControl(new BillboardControl());
bitmaps.put(e.getId(), bt);
//AppFacade.getMainSceneNode().attachChild(bt);
RendererPlatform.getApp().getGuiNode().attachChild(bt);
onEntityUpdated(e);
}
示例7: create
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
public void create(Node object, String text, String font, ColorRGBA color) {
BitmapFont bfont = getFont(font);
BitmapText label = new BitmapText(bfont, false);
label.setSize(bfont.getCharSet().getRenderedSize() * 2.0f);
label.setColor(color);
label.setText(text);
guiNode.attachChild(label);
labels.put(object, label);
object.setUserData("symbol", text);
}
示例8: starting
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
public void starting () {
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText("Write Your Annotation"); // crosshairs
ch.setColor(new ColorRGBA(1f,0.8f,0.1f,1f));
ch.setLocalTranslation(settings.getWidth()*0.3f,settings.getHeight()*0.1f,0);
guiNode.attachChild(ch);
viewPort.setBackgroundColor(ColorRGBA.Gray);
flyCam.setMoveSpeed(30);
}
示例9: simpleInitApp
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Box a = new Box(Vector3f.ZERO, 1, 1, 1);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
for (int i=0; i<10; i++){
Geometry geom = new Geometry("Box"+i, a);
geom.setLocalTranslation(0, i*3, 0);
geom.updateModelBound();
geom.setMaterial(mat);
Node ndParent = new Node("Parent" + i);
ndParent.attachChild(geom);
rootNode.attachChild(ndParent);
}
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText("Tree of the scene. Thanks to @perfecticus. Swing thing. :)"); // crosshairs
ch.setColor(new ColorRGBA(1f,0.8f,0.1f,1f));
ch.setLocalTranslation(settings.getWidth()*0.2f,settings.getHeight()*0.1f,0);
guiNode.attachChild(ch);
NodeTreeViewer tree = new NodeTreeViewer(rootNode);
viewPort.setBackgroundColor(ColorRGBA.Gray);
flyCam.setMoveSpeed(30);
}
示例10: simpleInitApp
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Box a = new Box(Vector3f.ZERO, 1, 1, 1);
geom = new Geometry("Box", a);
geom.setLocalTranslation(0, -1, 0);
geom.updateModelBound();
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
geom.setMaterial(mat);
rootNode.attachChild(geom);
// guiNode.detachAllChildren();
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText(geom.getName()); // crosshairs
ch.setColor(new ColorRGBA(1f,0.8f,0.3f,0.8f));
guiNode.attachChild(ch);
geom2 = geom.clone();
geom2.scale(10f);
guiNode.attachChild(geom2);
viewPort.setBackgroundColor(ColorRGBA.Gray);
flyCam.setMoveSpeed(30);
}
示例11: simpleInitApp
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Box a = new Box(Vector3f.ZERO, 1, 1, 1);
geom = new Geometry("Box", a);
geom.setLocalTranslation(0, -1, 0);
geom.updateModelBound();
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
geom.setMaterial(mat);
rootNode.attachChild(geom);
Box b = new Box(Vector3f.ZERO, 2.0f, 0.01f, 2.0f);
Geometry plane = new Geometry("Box", b);
plane.setLocalTranslation(0, -2, 0);
plane.updateModelBound();
Material matpl = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
matpl.setColor("Color", ColorRGBA.Red);
plane.setMaterial(matpl);
rootNode.attachChild(plane);
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText("Box is Looking At You"); // crosshairs
ch.setColor(new ColorRGBA(1f,0.8f,0.1f,1f));
ch.setLocalTranslation(settings.getWidth()*0.3f,settings.getHeight()*0.1f,0);
guiNode.attachChild(ch);
flyCam.setMoveSpeed(30);
viewPort.setBackgroundColor(ColorRGBA.Gray);
}
示例12: starting
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
public void starting () {
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText("Shooting Cube!"); // crosshairs
ch.setColor(new ColorRGBA(1f,0.8f,0.1f,1f));
ch.setLocalTranslation(settings.getWidth()*0.3f,settings.getHeight()*0.1f,0);
guiNode.attachChild(ch);
viewPort.setBackgroundColor(ColorRGBA.Gray);
flyCam.setMoveSpeed(30);
cam.setLocation(new Vector3f(0f,3f,30f));
}
示例13: simpleInitApp
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Circle3d circle = new Circle3d(Vector3f.ZERO, 3f, 32);
Geometry geom = new Geometry("Box", circle);
geom.updateModelBound();
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Red);
geom.setMaterial(mat);
geom.setLocalTranslation(0,2,1);
rootNode.attachChild(geom);
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText("Circle Mesh Example"); // crosshairs
ch.setColor(new ColorRGBA(1f,0.8f,0.1f,1f));
ch.setLocalTranslation(settings.getWidth()*0.3f,settings.getHeight()*0.1f,0);
guiNode.attachChild(ch);
flyCam.setMoveSpeed(30);
viewPort.setBackgroundColor(ColorRGBA.Gray);
}
示例14: simpleInitApp
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Random randomGenerator = new Random();
for (float i = 0; i < settings.getWidth(); i+=settings.getWidth()/10) {
for (float j = 0; j < settings.getHeight(); j+=settings.getHeight()/10) {
int borderAngle = randomGenerator.nextInt(360);
int innerAngle = randomGenerator.nextInt(360);
Color randomBorderColor = new Color(randomGenerator.nextInt(255), randomGenerator.nextInt(255), randomGenerator.nextInt(255));
Color randomInnerColor = new Color(randomGenerator.nextInt(255), randomGenerator.nextInt(255), randomGenerator.nextInt(255));
Circle2d circle = new Circle2d(assetManager, 1, randomGenerator.nextInt(20), randomBorderColor, borderAngle, randomInnerColor, innerAngle);
circle.setLocalTranslation(0, 0, 0);
guiNode.attachChild(circle);
circle.rotate(90, 0,0);
circle.setLocalTranslation(new Vector3f(i , j, 0));
circle.scale(70);
}
}
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText("Circle2d Mesh Example"); // crosshairs
ch.setColor(new ColorRGBA(1f, 0.8f, 0.1f, 1f));
ch.setLocalTranslation(settings.getWidth() * 0.3f, settings.getHeight() * 0.1f, 0);
guiNode.attachChild(ch);
flyCam.setEnabled(false);
viewPort.setBackgroundColor(ColorRGBA.Gray);
}
示例15: UI
import com.jme3.font.BitmapText; //导入方法依赖的package包/类
void UI() {
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText ch = new BitmapText(guiFont, false);
ch.setSize(guiFont.getCharSet().getRenderedSize());
ch.setText("W, E, Space, LeftMouse, MiddleMouse, RightMouse"); // crosshairs
ch.setColor(new ColorRGBA(1f, 0.8f, 0.1f, 1f));
ch.setLocalTranslation(settings.getWidth() * 0.3f, settings.getHeight() * 0.1f, 0);
guiNode.attachChild(ch);
}