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


Java Image.getColor方法代码示例

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


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

示例1: addBackgroundObject

import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
private void addBackgroundObject(boolean anywhere) {
    final Image image = new Image(backgroundDrawables.random());
    backgroundLayer.addActor(image);


    float scale = 0.5f * MathUtils.random(1, 2);
    image.setSize(image.getPrefWidth() * scale, image.getPrefHeight() * scale);
    image.setRotation(MathUtils.random(0, 1) * 180);
    image.getColor().a = MathUtils.random(0.1f, 0.3f);

    float w = Math.max(world.stage.getWidth(), root.getWidth() + ViewScroller.LEFT + ViewScroller.RIGHT);
    float h = Math.max(world.stage.getHeight(), root.getHeight() + ViewScroller.TOP + ViewScroller.BOTTOM);

    if (anywhere)
        image.setPosition(-root.getX() + w * MathUtils.random(), -root.getY() + h * MathUtils.random());
    else
        image.setPosition(-root.getX() - image.getWidth(), -root.getY() + h * MathUtils.random());

    image.addAction(Actions.sequence(
        Actions.moveBy(w + image.getWidth() - image.getX(), 0, 15 + MathUtils.random(6)),
        Actions.run(new Runnable() {
            @Override public void run() {
                image.remove();
                addBackgroundObject(false);
            }
        })
    ));
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:29,代码来源:ViewController.java

示例2: highlight

import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
private void highlight(IntArray indices) {
    for (int i = 0; i < indices.size; i++) {
        Vector2 pos = iconPositions[indices.get(i)];
        Image image = new Image(Config.skin, "ui/dice-window/net-selection-selected");
        image.setPosition(pos.x - 2, pos.y - 2);
        addActor(image);
        image.toBack();
        image.getColor().a = 0f;
        blink(image);
        highlights.add(image);
    }
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:13,代码来源:DieNet.java

示例3: LoadingWindow

import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public LoadingWindow(T windowToLoad, LoadingIndicatorStyle style,
		Loader<T> loader) {
	super(windowToLoad.getTitleLabel().getText().toString(), windowToLoad
			.getStyle());
	setMovable(false);
	this.windowToLoad = windowToLoad;
	this.loader = loader;
	loader.load(am);
	Group parent = windowToLoad.getParent();
	windowToLoad.remove();
	windowToLoad.setVisible(false);
	parent.addActor(this);
	setVisible(true);
	Image spinner = new Image(style.spinnerImage);
	spinner.setOrigin(spinner.getWidth() / 2, spinner.getHeight() / 2);
	spinner.getColor().a = 0;
	spinner.addAction(Actions.fadeIn(0.8f));
	spinner.addAction(Actions.forever(Actions.rotateBy(-360, style.rotationDuration)));
	add(spinner).center();
	row();
	add(new Label(Strings.getString(UIManager.STRING_TABLE, "loading",""), style.loadingLabelStyle))
		.center().padTop(style.loadingLabelMarginTop);
	pack();
	
	float minWidth = getWidth(); 
	float minHeight = getHeight();
	setWidth(windowToLoad.getWidth() > minWidth ? windowToLoad.getWidth() : minWidth);
	setHeight(windowToLoad.getHeight() > minHeight ? windowToLoad.getHeight() : minHeight);
	setPosition(windowToLoad.getX(), windowToLoad.getY());
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:31,代码来源:LoadingWindow.java

示例4: LearningSession

import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public LearningSession(AbstractGame game, int session, Deck<CardData> masterDeck, Deck<CardData> activeDeck) {
	super(game);
	this.session = session;
	this.masterDeck = masterDeck;
	this.activeDeck = activeDeck;
	setBackdrop(CLL1.BACKDROP);
	setSkin(CLL1.SKIN);

	log("Session: " + session);
	log("Master Deck Size: " + masterDeck.size());
	log("Active Deck Size: " + activeDeck.size());
	log("First Time: " + (activeDeck.size() == 0));

	stage.addAction(actionUpdateTimeLeft());

	lblCountdown = new Label("0:00", skin);
	lblCountdown.setFontScale(.75f);

	challengeText = new Label("", skin);
	choice1 = new Stack();
	choice2 = new Stack();

	choice1.setTouchable(Touchable.childrenOnly);
	choice2.setTouchable(Touchable.childrenOnly);

	Gdx.app.postRunnable(init1);
	Gdx.app.postRunnable(init2);
	Gdx.app.postRunnable(firstPlay);

	assets.load(CHECKMARK, Texture.class);
	assets.load(XMARK, Texture.class);
	assets.finishLoadingAsset(CHECKMARK);
	assets.finishLoadingAsset(XMARK);
	checkmark = assets.get(CHECKMARK, Texture.class);
	xmark = assets.get(XMARK, Texture.class);
	imgCheckmark = new Image(checkmark);
	imgCheckmark.setScaling(Scaling.fit);
	imgCheckmark.setColor(new Color(Color.FOREST));
	imgCheckmark.getColor().a = .75f;
	imgXmark = new Image(xmark);
	imgXmark.setScaling(Scaling.fit);
	imgXmark.setColor(new Color(Color.FIREBRICK));
	imgXmark.getColor().a = .75f;

	assets.load(BUZZER, Sound.class);
	assets.load(DING, Sound.class);
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:48,代码来源:LearningSession.java

示例5: init

import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
@Override protected void init() {
    stage.getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    textureImage = new Texture("logo-image.png");
    textureText = new Texture("logo-text.png");

    final Image image = new Image(textureImage);
    image.setPosition(stage.getWidth() / 2 - image.getWidth() / 2, stage.getHeight() / 2 - image.getHeight() / 2);

    final Image text = new Image(textureText);
    text.setPosition(image.getX(), image.getY());

    stage.addActor(image);
    stage.addActor(text);
    image.getColor().a = 0;
    text.getColor().a = 0;

    image.addAction(Actions.sequence(
        Actions.alpha(1, 0.3f),
        Actions.run(new Runnable() {
            @Override public void run() {
                text.addAction(
                    Actions.sequence(
                        Actions.alpha(1, 0.3f),
                        Actions.delay(1.5f),
                        Actions.run(new Runnable() {
                            @Override public void run() {
                                image.addAction(Actions.alpha(0, 0.3f));
                                text.addAction(Actions.sequence(
                                    Actions.alpha(0, 0.3f),
                                    Actions.run(new Runnable() {
                                        @Override public void run() {
                                            callback.onEnded();
                                        }
                                    })
                                ));
                            }
                        })
                    )
                );
            }
        })
    ));
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:44,代码来源:IntroState.java


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