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


Java ProgressBar.setValue方法代码示例

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


在下文中一共展示了ProgressBar.setValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addNormalWidgets

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
private void addNormalWidgets () {
	ProgressBar progressbar = new ProgressBar(0, 100, 1, true, VisUI.getSkin());
	Slider slider = new Slider(0, 100, 1, true, VisUI.getSkin());
	Slider sliderDisabled = new Slider(0, 100, 1, true, VisUI.getSkin());

	progressbar.setValue(50);
	slider.setValue(50);
	sliderDisabled.setValue(50);
	sliderDisabled.setDisabled(true);

	VisTable progressbarTable = new VisTable(true);
	progressbarTable.add(progressbar);
	progressbarTable.add(slider);
	progressbarTable.add(sliderDisabled);

	add(progressbarTable);
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:18,代码来源:TestVertical.java

示例2: EnegryBar

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
public EnegryBar(int width, int height, int x, int y) {
    energyBar = new ProgressBar(0, LevelMap.getLevel().getMaxEnergy(), 0.5f, true, /*GDefence.getInstance().assetLoader.getEnergyBarSkin()*/ GDefence.getInstance().assetLoader.getSkin(), "energy-bar");
    energyBar.getStyle().background.setMinWidth(width);
    energyBar.getStyle().knobBefore.setMinWidth(width - 2);
    energyBar.setPosition(x, y);
    //setPosition(Gdx.graphics.getWidth() - expBarSize[0], userlevelButton.getY() - expBarSize[1] - 4);
    energyBar.setSize(width, height);
    energyBar.setValue(LevelMap.getLevel().getEnergyNumber());
    energyBar.setAnimateDuration(0.5f);
    addActor(energyBar);
    initLabel();
}
 
开发者ID:mrDarkHouse,项目名称:GDefence,代码行数:13,代码来源:EnegryBar.java

示例3: init

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
public void init(){
        getTitleLabel().setText(tower.getTowerPrototype().getName());

        info = new Label("", skin, "description");
        info.getStyle().font.getData().markupEnabled = true;
        level = new Label("", skin, "description");

        levelString = GDefence.getInstance().assetLoader.getWord("level") + " ";
        levelNum = tower.getTowerPrototype().getLevel();

        final float width = getWidth();
        expBar = new ProgressBar(0, tower.getTowerPrototype().exp2nextLevel()[tower.getTowerPrototype().getLevel() - 1], 0.2f, false,
                GDefence.getInstance().assetLoader.getExpBarSkin()) {
            @Override
            public float getPrefWidth() {
                return width - 10;
            }
        };//add text inside
        expBar.getStyle().background.setMinHeight(20);
        expBar.getStyle().knob.setMinHeight(20);
//        expBar.getStyle().background.setMinWidth(width - 10);
        expBar.getStyle().knob.setMinWidth(0.1f);
//                expBar.setSize(80, 20);//dont work first argument
        expBar.setValue(tower.getTowerPrototype().getCurrentExp());


        add(info).row();
        add(level).align(Align.center).row();
        add(expBar).align(Align.center);


        hasChanged();

        pack();

        tower.getStage().addActor(this);

        setVisible(false);
    }
 
开发者ID:mrDarkHouse,项目名称:GDefence,代码行数:40,代码来源:TowerTooltip.java

示例4: getNewInstanceOfActor

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
@Override
protected Actor getNewInstanceOfActor(final LmlActorBuilder builder) {
    final FloatRangeLmlActorBuilder rangeBuilder = (FloatRangeLmlActorBuilder) builder;
    rangeBuilder.validateRange(getParser());
    final ProgressBar actor = getNewInstanceOfProgressBar(rangeBuilder);
    actor.setValue(rangeBuilder.getValue());
    return actor;
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:9,代码来源:ProgressBarLmlTag.java

示例5: DrawOneAttachers

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
private Group DrawOneAttachers(String typeFrame, String name, Color type, String photo, float energy,float energymax) {
    Group gr = new Group();
    Texture txt = managerAssets.getAssetsCombat().getTexture(typeFrame);
    Vector2 crop = Scaling.fit.apply(txt.getWidth(),txt.getHeight(),WIDTH,HEIGHT);
    final Image frame = new Image(new TextureRegion(txt));
    frame.setName("frame");
    frame.setSize(crop.x * 0.18f, crop.y * 0.2f);
    frame.setPosition(WIDTH - frame.getWidth() * 1.13f, HEIGHT / 2.3f);
    gr.addActor(frame);
    if(InformationProfile.getInstance().getDateUserGame().getFaction() != InformationEnklave.getInstance().getFaction())
        txt = managerAssets.getAssetsCombat().getTexture(NameFiles.targetRecharge);
    else
        txt = managerAssets.getAssetsCombat().getTexture(NameFiles.target);
    crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
    Image frameselect = new Image(new TextureRegion(txt));
    frameselect.setSize(crop.x * 0.18f, crop.y * 0.2f);
    frameselect.setName("frameselect");
    frameselect.toFront();
    frameselect.setPosition(WIDTH - frame.getWidth() * 1.13f, HEIGHT / 2.3f);
    frameselect.setVisible(false);
    gr.addActor(frameselect);
    Label labelName = new Label(name.substring(0,name.length()>9 ? 9 : name.length()), new Label.LabelStyle(bt, type));
    labelName.setAlignment(Align.center);
    labelName.setWidth(crop.x*0.18f);
    labelName.setPosition(frame.getX(), frame.getY() + frame.getHeight() * 0.25f);
    gr.addActor(labelName);
    txt = managerAssets.getAssetsCombat().getTexture(photo);
    crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
    Image profile = new Image(new TextureRegion(txt));
    profile.setColor(type);
    profile.setSize(crop.x * 0.07f, crop.y * 0.07f);
    profile.setPosition(frame.getRight() - frame.getWidth() / 2 - profile.getWidth() / 2, frame.getY() + frame.getHeight() * 0.42f);
    gr.addActor(profile);
    Skin skin = new Skin();
    skin.add("white", new TextureRegion(managerAssets.getAssetsCombat().getTexture(NameFiles.barLifeWhite), 0, 0, (int) (WIDTH * 0.014), (int) (WIDTH * 0.014)));
    ProgressBar.ProgressBarStyle barStyle = new ProgressBar.ProgressBarStyle(skin.newDrawable("white", Color.WHITE), skin.newDrawable("white", type));
    barStyle.knobBefore = barStyle.knob;
    ProgressBar bar = new ProgressBar(0,energymax, 1, false, barStyle);
    bar.setSize(WIDTH * 0.14f,HEIGHT * 0.012f);
    bar.setPosition(frame.getX() + frame.getWidth() * 0.07f, frame.getY() + frame.getHeight() * 0.07f);
    bar.setValue(energy);
    gr.addActor(bar);
    return gr;
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:45,代码来源:DrawAttachers.java

示例6: drawoneDefenders

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
private Group drawoneDefenders(String typeFrame,String name,Color type,String photo,float energy,float energymax){
        Group gr = new Group();
        Texture txt = managerAssets.getAssetsCombat().getTexture(typeFrame);
        Vector2 crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
        Image frame = new Image(new TextureRegion(txt));
        frame.setName("frame");
        frame.setSize(crop.x * 0.18f, crop.y * 0.2f);
        frame.setPosition(WIDTH * 0.025f, HEIGHT / 2.3f);
        gr.addActor(frame);
        if(InformationProfile.getInstance().getDateUserGame().getFaction() == InformationEnklave.getInstance().getFaction())
            txt = managerAssets.getAssetsCombat().getTexture(NameFiles.targetRecharge);
        else
            txt = managerAssets.getAssetsCombat().getTexture(NameFiles.target);
        crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
        Image frameselect = new Image(new TextureRegion(txt));
        frameselect.setName("frameselect");
        frameselect.toFront();
        frameselect.setSize(crop.x * 0.18f, crop.y * 0.2f);
        frameselect.setPosition(WIDTH * 0.025f, HEIGHT / 2.3f);
        frameselect.setVisible(false);
        gr.addActor(frameselect);
        Label labelName = new Label(name.substring(0,name.length()>9 ? 9 : name.length()),new Label.LabelStyle(bt,type));
        labelName.setAlignment(Align.center);
        labelName.setSize(WIDTH * 0.18f, HEIGHT * 0.02f);
        labelName.setPosition(frame.getX(), frame.getY() + frame.getHeight() * 0.25f);
        gr.addActor(labelName);
        txt = managerAssets.getAssetsCombat().getTexture(photo);
        crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
        Image profile = new Image(new TextureRegion(txt));
//        profile.setColor(Color.BLUE);
        profile.setSize(crop.x*0.07f, crop.y*0.07f);
        profile.setPosition(frame.getRight() - frame.getWidth() / 2 - profile.getWidth() / 2, frame.getY() + frame.getHeight() * 0.42f);
        gr.addActor(profile);
        Skin skin = new Skin();
        skin.add("white", new TextureRegion(managerAssets.getAssetsCombat().getTexture(NameFiles.barLifeWhite),0,0,(int)(WIDTH*0.004),(int)(WIDTH*0.014)));
        ProgressBar.ProgressBarStyle barStyle = new ProgressBar.ProgressBarStyle(skin.newDrawable("white", Color.WHITE), skin.newDrawable("white",type));
        barStyle.knobBefore = barStyle.knob;
        ProgressBar bar = new ProgressBar(0, energymax, 1, false, barStyle);
        bar.setSize(WIDTH * 0.14f, HEIGHT * 0.012f);
        bar.setPosition(frame.getX()+frame.getWidth()*0.1f, frame.getY()+frame.getHeight()*0.07f);
        bar.setValue(energy);
        gr.addActor(bar);
        return gr;
    }
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:45,代码来源:DrawDefenders.java

示例7: advanceLoadingProgress

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
@LmlAction("load")
public void advanceLoadingProgress(final ProgressBar progressBar) {
    progressBar.setValue(progressBar.getValue() + progressBar.getStepSize() * 5f);
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:MainView.java

示例8: setInitialValue

import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; //导入方法依赖的package包/类
/** @param bar will have a random initial value set. */
public void setInitialValue(final ProgressBar bar) {
    bar.setValue(MathUtils.random(bar.getMinValue(), bar.getMaxValue()));
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:MainView.java


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