当前位置: 首页>>代码示例>>Java>>正文


Java Picture.setImage方法代码示例

本文整理汇总了Java中com.jme3.ui.Picture.setImage方法的典型用法代码示例。如果您正苦于以下问题:Java Picture.setImage方法的具体用法?Java Picture.setImage怎么用?Java Picture.setImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.ui.Picture的用法示例。


在下文中一共展示了Picture.setImage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:TestZOrder.java

示例2: initialize

import com.jme3.ui.Picture; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    this.app = app;
    if (assetManager == null) {
        assetManager = app.getAssetManager();
    }
    if (guiNode == null && app instanceof SimpleApplication) {
        guiNode = ((SimpleApplication) app).getGuiNode();
    }
    if (guiNode == null || assetManager == null) {
        throw new NullPointerException("guiNode or assetManager not specified!");
    }
    splash = new Picture("Splash Image");
    splash.setImage(assetManager, pictureLocation, false);

    guiNode.attachChild(splash);
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:19,代码来源:SplashAppState.java

示例3: 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);		
}
 
开发者ID:riccardobl,项目名称:jme3-plugin-flac-loader,代码行数:17,代码来源:FLACLoaderTest.java

示例4: initGuiElements

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void initGuiElements()
{
    spiderInfo = new Picture("spiderInfo");
    spiderInfo.setImage(simpleApp.getAssetManager(), "Interface/spiderInfo.png", true);
    spiderInfo.setWidth(796);
    spiderInfo.setHeight(94);
    spiderInfo.move(270, 50, -1);
    
    ghostInfo = new Picture("ghostInfo");
    ghostInfo.setImage(simpleApp.getAssetManager(), "Interface/ghostInfo.png", true);
    ghostInfo.setWidth(796);
    ghostInfo.setHeight(94);
    ghostInfo.move(270, 50, -1);
    
    inventoryBackground = new Picture("inventoryBackground");
    inventoryBackground.setImage(simpleApp.getAssetManager(), "Interface/inventoryBackground.png", true);
    inventoryBackground.setWidth(798);
    inventoryBackground.setHeight(500);
    inventoryBackground.move(270, 50, -1);
    
    exit = new Picture("exit");
    exit.setImage(simpleApp.getAssetManager(), "Interface/exitMenu.png", true);
    exit.setWidth(1000);
    exit.setHeight(499);
    exit.move(160, 500, -1);
}
 
开发者ID:abnercoimbre,项目名称:tower-defense-cave,代码行数:27,代码来源:InterfaceAppState.java

示例5: addInventoryOptions

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void addInventoryOptions() 
{
    for (int i = 0; i < optionNames.length; i++) 
    {
        Picture option = new Picture(optionNames[i]);
        option.setImage(simpleApp.getAssetManager(), 
                        "Interface/" + optionNames[i] + ".png", 
                        true);
        option.setWidth(78);
        option.setHeight(247);
        option.move(370 + 250*i, 175, 0);
        simpleApp.getGuiNode().attachChild(option);
    }
    
    /* Highlight first option */
    highlightInventoryOption("laserTower");
}
 
开发者ID:abnercoimbre,项目名称:tower-defense-cave,代码行数:18,代码来源:InterfaceAppState.java

示例6: showBudget

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void showBudget() 
{
    Picture budgetIcon = new Picture("budgetIcon");
    budgetIcon.setImage(simpleApp.getAssetManager(), "Interface/budget.png", true);
    budgetIcon.setWidth(64);
    budgetIcon.setHeight(64);
    budgetIcon.move(15, 40, 0);
    simpleApp.getGuiNode().attachChild(budgetIcon);
    
    BitmapFont myFont = simpleApp.getAssetManager().loadFont("Interface/Fonts/PoorRichardBig.fnt");
    BitmapText budgetText = new BitmapText(myFont);
    budgetText.setName("budgetText");
    budgetText.setSize(myFont.getCharSet().getRenderedSize());
    budgetText.setText(Integer.toString(currentGameState.getBudget()));
    budgetText.move(92, 86, 0);
    simpleApp.getGuiNode().attachChild(budgetText);
}
 
开发者ID:abnercoimbre,项目名称:tower-defense-cave,代码行数:18,代码来源:InterfaceAppState.java

示例7: 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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:12,代码来源:TestOrtho.java

示例8: 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();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:TestVideoPlayer.java

示例9: initialize

import com.jme3.ui.Picture; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    this.app = (MVApplication) app;

    assetManager = app.getAssetManager();
    guiNode = this.app.getRootNode();
    java.util.logging.Logger.getLogger("de.lessvoid.nifty")
            .setLevel(java.util.logging.Level.OFF);
    display = new NiftyJmeDisplay(
            app.getAssetManager(), app.getInputManager(),
            app.getAudioRenderer(), ((SimpleApplication) app).getGuiViewPort());

    nifty = display.getNifty();

    nifty.fromXml(Constants.android ? "Interface/nifty-android.xml"
            : "Interface/nifty-desktop.xml", "start", this);

    ((SimpleApplication) app).getGuiViewPort().addProcessor(display);

    background = new Picture("Background Image!");
    background.setImage(assetManager,
            Constants.android ? "Textures/nifty-background-lq.jpg"
                    : "Textures/nifty-background-hq.jpg", false);

    guiNode.attachChild(background);
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:28,代码来源:NiftyAppState.java

示例10: getPicture

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private Picture getPicture(String path) {
    Picture pic = new Picture("Picture");
    pic.setImage(assetManager, path, true);
    pic.setWidth(camera.getHeight());
    pic.setHeight(camera.getHeight());
    return pic;
}
 
开发者ID:mathiasj33,项目名称:JMEPieMenu,代码行数:8,代码来源:PieMenuState.java

示例11: 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);

}
 
开发者ID:mosstest,项目名称:mosstest,代码行数:10,代码来源:RenderProcessor.java

示例12: setLaserTowerText

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void setLaserTowerText(boolean canSetText) 
{
    if (canSetText) 
    {
        BitmapFont myFont = simpleApp.getAssetManager().loadFont("Interface/Fonts/PoorRichardBig.fnt");
        BitmapText laserTowerText = new BitmapText(myFont);
        laserTowerText.setName("laserTowerText");
        laserTowerText.setSize(myFont.getCharSet().getRenderedSize());
        laserTowerText.setText("Laser              10");
        laserTowerText.move(350, 160, 0);
        simpleApp.getGuiNode().attachChild(laserTowerText);
        
        Picture budgetSmallIcon = new Picture("budgetSmallIcon1");
        budgetSmallIcon.setImage(simpleApp.getAssetManager(), "Interface/budgetSmall.png", true);
        budgetSmallIcon.setWidth(50);
        budgetSmallIcon.setHeight(50);
        budgetSmallIcon.move(410, 120, 0);
        simpleApp.getGuiNode().attachChild(budgetSmallIcon);
        return;
    }

    Spatial text = simpleApp.getGuiNode().getChild("laserTowerText");
    if (text != null)
        text.removeFromParent();
    
    Spatial textIcon = simpleApp.getGuiNode().getChild("budgetSmallIcon1");
    if (textIcon != null)
        textIcon.removeFromParent();
}
 
开发者ID:abnercoimbre,项目名称:tower-defense-cave,代码行数:30,代码来源:InterfaceAppState.java

示例13: setLightTowerText

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void setLightTowerText(boolean canSetText) 
{
    if (canSetText) 
    {
        BitmapFont myFont = simpleApp.getAssetManager().loadFont("Interface/Fonts/PoorRichardBig.fnt");
        BitmapText lightTowerText = new BitmapText(myFont);
        lightTowerText.setName("lightTowerText");
        lightTowerText.setSize(myFont.getCharSet().getRenderedSize());
        lightTowerText.setText("Light              15");
        lightTowerText.move(600, 160, 0);
        simpleApp.getGuiNode().attachChild(lightTowerText);
        
        Picture budgetSmallIcon = new Picture("budgetSmallIcon2");
        budgetSmallIcon.setImage(simpleApp.getAssetManager(), "Interface/budgetSmall.png", true);
        budgetSmallIcon.setWidth(50);
        budgetSmallIcon.setHeight(50);
        budgetSmallIcon.move(660, 120, 0);
        simpleApp.getGuiNode().attachChild(budgetSmallIcon);
        return;
    }

    Spatial text = simpleApp.getGuiNode().getChild("lightTowerText");
    if (text != null)
        text.removeFromParent();
    
    Spatial textIcon = simpleApp.getGuiNode().getChild("budgetSmallIcon2");
    if (textIcon != null)
        textIcon.removeFromParent();
}
 
开发者ID:abnercoimbre,项目名称:tower-defense-cave,代码行数:30,代码来源:InterfaceAppState.java

示例14: setUnknownTowerText

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void setUnknownTowerText(boolean canSetText) 
{
    if (canSetText) 
    {
        BitmapFont myFont = simpleApp.getAssetManager().loadFont("Interface/Fonts/PoorRichardBig.fnt");
        BitmapText unknownTowerText = new BitmapText(myFont);
        unknownTowerText.setName("unknownTowerText");
        unknownTowerText.setSize(myFont.getCharSet().getRenderedSize());
        unknownTowerText.setText("?????              30");
        unknownTowerText.move(850, 160, 0);
        simpleApp.getGuiNode().attachChild(unknownTowerText);
        
        Picture budgetSmallIcon = new Picture("budgetSmallIcon3");
        budgetSmallIcon.setImage(simpleApp.getAssetManager(), "Interface/budgetSmall.png", true);
        budgetSmallIcon.setWidth(50);
        budgetSmallIcon.setHeight(50);
        budgetSmallIcon.move(910, 120, 0);
        simpleApp.getGuiNode().attachChild(budgetSmallIcon);
        return;
    }

    Spatial text = simpleApp.getGuiNode().getChild("unknownTowerText");
    if (text != null)
        text.removeFromParent();
    
    Spatial textIcon = simpleApp.getGuiNode().getChild("budgetSmallIcon3");
    if (textIcon != null)
        textIcon.removeFromParent();
}
 
开发者ID:abnercoimbre,项目名称:tower-defense-cave,代码行数:30,代码来源:InterfaceAppState.java

示例15: resetInventoryOptions

import com.jme3.ui.Picture; //导入方法依赖的package包/类
private void resetInventoryOptions() 
{
    for (int i = 0; i < optionNames.length; i++) 
    {
        Picture option = (Picture) simpleApp.getGuiNode().getChild(optionNames[i]);
        option.setImage(simpleApp.getAssetManager(), "Interface/" + optionNames[i] + ".png", true);
    }
    laserTowerSelected = false;
    setLaserTowerText(false);
    setLightTowerText(false);
    setUnknownTowerText(false);
    
    lightTowerSelected = false;
    unknownTowerSelected = false;
}
 
开发者ID:abnercoimbre,项目名称:tower-defense-cave,代码行数:16,代码来源:InterfaceAppState.java


注:本文中的com.jme3.ui.Picture.setImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。