本文整理汇总了Java中com.jme3.ui.Picture.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Picture.setPosition方法的具体用法?Java Picture.setPosition怎么用?Java Picture.setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.ui.Picture
的用法示例。
在下文中一共展示了Picture.setPosition方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleInitApp
import com.jme3.ui.Picture; //导入方法依赖的package包/类
public void simpleInitApp() {
Picture p = new Picture("Picture1");
p.move(0,0,-1);
p.setPosition(100, 100);
p.setWidth(100);
p.setHeight(100);
p.setImage(assetManager, "Interface/Logo/Monkey.png", false);
guiNode.attachChild(p);
Picture p2 = new Picture("Picture2");
p2.move(0,0,1.001f);
p2.setPosition(150, 150);
p2.setWidth(100);
p2.setHeight(100);
p2.setImage(assetManager, "Interface/Logo/Monkey.png", false);
guiNode.attachChild(p2);
}
示例2: simpleInitApp
import com.jme3.ui.Picture; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
FLACLoader.init(assetManager);
AudioNode test_flac =new AudioNode(assetManager,"publicdomain.tropicx.flac",DataType.Buffer);
test_flac.setPositional(false);
test_flac.setLooping(true);
test_flac.setVolume(1f);
rootNode.attachChild(test_flac);
test_flac.play();
Picture pc=new Picture("bg");
pc.setImage(assetManager,"publicdomain.sunsetintheswamp.png",false);
pc.setHeight(settings.getHeight());
pc.setWidth(settings.getWidth());
pc.setPosition(0,0);
guiNode.attachChild(pc);
}
示例3: simpleInitApp
import com.jme3.ui.Picture; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
int w = settings.getWidth();
int h = settings.getHeight();
//setup framebuffer
fb = new FrameBuffer(w, h, 1);
Texture2D fbTex = new Texture2D(w, h, Format.RGBA8);
fb.setDepthBuffer(Format.Depth);
fb.setColorTexture(fbTex);
// setup framebuffer's scene
Sphere sphMesh = new Sphere(20, 20, 1);
Material solidColor = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
Geometry sphere = new Geometry("sphere", sphMesh);
sphere.setMaterial(solidColor);
fbNode.attachChild(sphere);
//setup main scene
Picture p = new Picture("Picture");
p.setPosition(0, 0);
p.setWidth(w);
p.setHeight(h);
p.setTexture(assetManager, fbTex, false);
rootNode.attachChild(p);
}
示例4: simpleInitApp
import com.jme3.ui.Picture; //导入方法依赖的package包/类
public void simpleInitApp() {
Picture p = new Picture("Picture");
p.move(0, 0, -1); // make it appear behind stats view
p.setPosition(0, 0);
p.setWidth(settings.getWidth());
p.setHeight(settings.getHeight());
p.setImage(assetManager, "Interface/Logo/Monkey.png", false);
// attach geometry to orthoNode
guiNode.attachChild(p);
}
示例5: displayMap
import com.jme3.ui.Picture; //导入方法依赖的package包/类
protected void displayMap(Renderer r, Picture pic, int left) {
Camera cam = vp.getCamera();
rm.setCamera(cam, true);
int h = cam.getHeight();
pic.setPosition(left, h / 20f);
pic.setWidth(128);
pic.setHeight(128);
pic.updateGeometricState();
rm.renderGeometry(pic);
rm.setCamera(cam, false);
}
示例6: simpleInitApp
import com.jme3.ui.Picture; //导入方法依赖的package包/类
public void simpleInitApp() {
picture = new Picture("VideoPicture", true);
picture.setPosition(0, 0);
picture.setWidth(settings.getWidth());
picture.setHeight(settings.getHeight());
picture.setImage(assetManager, "Interface/Logo/Monkey.jpg", false);
// attach geometry to orthoNode
rootNode.attachChild(picture);
// start video playback
createVideo();
}
示例7: setupHud
import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void setupHud() {
Picture pic = new Picture("Crosshair");
pic.setImage(assetManager, "builtins/crosshair.png", true);
pic.setWidth(32);
pic.setHeight(32);
pic.setPosition(settings.getWidth() / 2 - 16, settings.getHeight() / 2 - 16);
guiNode.attachChild(pic);
}
示例8: buildBackground
import com.jme3.ui.Picture; //导入方法依赖的package包/类
protected void buildBackground() {
String bgKey = "background";
background = new Picture( "background" );
clearBackground();
background.setWidth( cam.getWidth() );
background.setHeight( cam.getHeight() );
background.setPosition( 0, 0 );
background.updateGeometricState();
ViewPort pv = renderManager.createPreView( bgKey, cam );
pv.setClearFlags( true, true, true );
pv.attachScene( background );
background.updateGeometricState();
}
示例9: initGui
import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void initGui() {
oneGui = new OneGui();
try (InputStream inputStream = Example1.class.getResourceAsStream("/example1.ogs")) {
oneGui.addStyles(inputStream);
} catch (Exception e) {
}
final Screen screen = new Screen(oneGui, "screen");
Panel leftPanel = new Panel(screen, "panelLeft");
Button startNewGameButton = new Button(leftPanel, "startNewGame");
startNewGameButton.addClickedEventListener(id -> {
System.out.println("Clicked: " + id);
});
Button showSettingsButton = new Button(leftPanel, "showSettings");
Panel centerspace = new Panel(screen, "panelCenterSpace");
Panel rightPanel = new Panel(screen, "panelRight");
label = new Label(rightPanel, "label1");
label.setText("SettingslåäöÅÄÖqhjKp");
Label settingsLabel2 = new Label(rightPanel, "label2");
settingsLabel2.setText("SettingslåäöÅÄÖqhjKp");
Label settingsLabel3 = new Label(rightPanel, "label3");
settingsLabel3.setText("SettingslåäöÅÄÖqhjKp");
Button button2 = new Button(rightPanel, "saveSettings");
startNewGameButton.click();
oneGuiRenderer = new OneGuiRenderer(screen, 1280, 720);
oneGuiRenderer.update(1);
final BufferedImage bufferedImage = oneGuiRenderer.generateImage();
image = new AWTLoader().load(bufferedImage, true);
final byte[] pixels = ((DataBufferByte) bufferedImage.getRaster().getDataBuffer()).getData();
flipImage(pixels, (int) oneGuiRenderer.getWidth(), (int) oneGuiRenderer.getHeight(), bufferedImage.getColorModel().getPixelSize());
byteBuffer = BufferUtils.createByteBuffer(pixels.length);
byteBuffer.put(pixels);
byteBuffer.flip();
texture = new Texture2D(image);
texture.setAnisotropicFilter(2);
final Picture picture = new Picture("HUD Picture");
picture.setWidth(settings.getWidth());
picture.setHeight(settings.getHeight());
picture.setPosition(0, 0);
picture.setTexture(assetManager, texture, true);
guiNode.attachChild(picture);
}