當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。