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


Java ITiledTextureRegion类代码示例

本文整理汇总了Java中org.andengine.opengl.texture.region.ITiledTextureRegion的典型用法代码示例。如果您正苦于以下问题:Java ITiledTextureRegion类的具体用法?Java ITiledTextureRegion怎么用?Java ITiledTextureRegion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ITiledTextureRegion类属于org.andengine.opengl.texture.region包,在下文中一共展示了ITiledTextureRegion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: pass

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
private void pass(Word word, final float wordX) {
    //TODO: count success
    Debug.d("ImageMatchGame : pass!");
    GameSounds.play(GameSounds.COMPLETE);
    this.winnings.add(word);
    float available_width = (this.cardPane.getWidth()/this.max_choices);
    float wordY = this.resultsPane.getHeight() + this.cardPane.getHeight() - 150;

    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite winning_sprite = new Sprite(wordX+(available_width/2), wordY, sprite_region.getTextureRegion(1), PhoeniciaContext.vboManager);
    this.resultsPane.attachChild(winning_sprite);
    winning_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, wordY, 80),
            new MoveXModifier(0.5f, wordX+(available_width/2), 40+(this.result_number*80))
            ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:19,代码来源:ImageMatchGameHUD.java

示例2: fail

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
private void fail(Word word, final float wordX) {
    //TODO: count failure
    Debug.d("ImageMatchGame : fail!");
    GameSounds.play(GameSounds.FAILED);
    float available_width = (this.cardPane.getWidth()/this.max_choices);
    float wordY = this.resultsPane.getHeight() + this.cardPane.getHeight() - 150;

    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite missed_sprite = new Sprite(wordX+(available_width/2), wordY, sprite_region.getTextureRegion(2), PhoeniciaContext.vboManager);
    this.resultsPane.attachChild(missed_sprite);
    missed_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, wordY, 80),
            new MoveXModifier(0.5f, wordX+(available_width/2), 48+(this.result_number*80))
            ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:18,代码来源:ImageMatchGameHUD.java

示例3: pass

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
private void pass(Word word, final float wordX) {
    Debug.d("NumberMatchGame : pass!");
    GameSounds.play(GameSounds.COMPLETE);
    this.winnings.add(word);
    float available_width = (this.cardPane.getWidth()/this.max_choices);
    float wordY = this.resultsPane.getHeight() + this.cardPane.getHeight() - 150;

    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite winning_sprite = new Sprite(wordX+(available_width/2), wordY, sprite_region.getTextureRegion(1), PhoeniciaContext.vboManager);
    this.resultsPane.attachChild(winning_sprite);
    winning_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, wordY, 80),
            new MoveXModifier(0.5f, wordX+(available_width/2), 40+(this.result_number*80))
    ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:18,代码来源:NumberMatchGameHUD.java

示例4: fail

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
private void fail(Word word, final float wordX) {
    Debug.d("NumberMatchGame : fail!");
    GameSounds.play(GameSounds.FAILED);
    float available_width = (this.cardPane.getWidth()/this.max_choices);
    float wordY = this.resultsPane.getHeight() + this.cardPane.getHeight() - 150;

    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite missed_sprite = new Sprite(wordX+(available_width/2), wordY, sprite_region.getTextureRegion(2), PhoeniciaContext.vboManager);
    this.resultsPane.attachChild(missed_sprite);
    missed_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, wordY, 80),
            new MoveXModifier(0.5f, wordX + (available_width / 2), 48 + (this.result_number * 80))
    ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:17,代码来源:NumberMatchGameHUD.java

示例5: pass

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
private void pass(Word word) {
    //TODO: count success
    Debug.d("wordmatch: pass!");
    GameSounds.play(GameSounds.COMPLETE);
    this.winnings.add(word);
    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite winning_sprite = new Sprite(this.cardPane.getWidth()/2, this.cardPane.getHeight() - 300, sprite_region.getTextureRegion(1), PhoeniciaContext.vboManager);
    winning_sprite.setZIndex(foreground_sprite.getZIndex()+1);
    this.resultsPane.attachChild(winning_sprite);
    winning_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, 300, 80),
            new MoveXModifier(0.5f, this.resultsPane.getWidth()/2, 40+(this.result_number*80))
            ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:17,代码来源:WordMatchGameHUD.java

示例6: ButtonSprite

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
public ButtonSprite(final float pX, final float pY, final ITiledTextureRegion pTiledTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	super(pX, pY, pTiledTextureRegion, pVertexBufferObjectManager);

	this.mOnClickListener = pOnClickListener;
	this.mStateCount = pTiledTextureRegion.getTileCount();

	switch (this.mStateCount) {
		case 1:
			Debug.w("No " + ITextureRegion.class.getSimpleName() + " supplied for " + State.class.getSimpleName() + "." + State.PRESSED + ".");
		case 2:
			Debug.w("No " + ITextureRegion.class.getSimpleName() + " supplied for " + State.class.getSimpleName() + "." + State.DISABLED + ".");
			break;
		case 3:
			break;
		default:
			throw new IllegalArgumentException("The supplied " + ITiledTextureRegion.class.getSimpleName() + " has an unexpected amount of states: '" + this.mStateCount + "'.");
	}

	this.changeState(State.NORMAL);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:21,代码来源:ButtonSprite.java

示例7: ButtonSprite

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
public ButtonSprite(final float pX, final float pY, final ITiledTextureRegion pTiledTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	super(pX, pY, pTiledTextureRegion, pVertexBufferObjectManager);

	this.mOnClickListener = pOnClickListener;
	this.mStateCount = pTiledTextureRegion.getTileCount();

	switch(this.mStateCount) {
		case 1:
			Debug.w("No " + ITextureRegion.class.getSimpleName() + " supplied for " + State.class.getSimpleName() + "." + State.PRESSED + ".");
		case 2:
			Debug.w("No " + ITextureRegion.class.getSimpleName() + " supplied for " + State.class.getSimpleName() + "." + State.DISABLED + ".");
			break;
		case 3:
			break;
		default:
			throw new IllegalArgumentException("The supplied " + ITiledTextureRegion.class.getSimpleName() + " has an unexpected amount of states: '" + this.mStateCount + "'.");
	}

	this.changeState(State.NORMAL);
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:21,代码来源:ButtonSprite.java

示例8: setAttention

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
public void setAttention(boolean attention) {
    if (this.attention == attention) return;
    Debug.d("Setting attention for word tile "+this.word.name+" to "+attention);
    this.attention = attention;
    if (this.attention) {
        final ITiledTextureRegion wordSpriteRegion = phoeniciaGame.wordSprites.get(this.word);
        final Sprite wordSprite = new Sprite(0, 0, wordSpriteRegion.getTextureRegion(1), PhoeniciaContext.vboManager);
        this.sprite.setEmblem(wordSprite);
    } else {
        this.sprite.clearEmblem();
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:13,代码来源:WordTile.java

示例9: setAttention

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
public void setAttention(boolean attention) {
    if (this.attention == attention) return;
    Debug.d("Setting attention for workshop tile "+builder.item_name.get()+" to "+attention);
    this.attention = attention;
    if (this.attention && phoeniciaGame.locale.word_map.containsKey(builder.item_name.get())) {
        final ITiledTextureRegion wordSpriteRegion = phoeniciaGame.wordSprites.get(phoeniciaGame.locale.word_map.get(builder.item_name.get()));
        if (wordSpriteRegion == null) return;
        final Sprite wordSprite = new Sprite(0, 0, wordSpriteRegion.getTextureRegion(1), PhoeniciaContext.vboManager);
        this.sprite.setEmblem(wordSprite);
    } else {
        this.sprite.clearEmblem();
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:14,代码来源:DefaultTile.java

示例10: show_reward

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
private void show_reward() {
    Collections.shuffle(this.winnings);
    final Word reward_word = this.winnings.get(0);
    final int reward_coins = Math.round(reward_word.sell * this.tile.game.reward);
    final int reward_points = Math.round(reward_word.points * this.tile.game.reward);

    final Dialog reward_dialog = new Dialog(400, 300, Dialog.Buttons.OK, PhoeniciaContext.vboManager, new Dialog.DialogListener() {
        @Override
        public void onDialogButtonClicked(Dialog dialog, Dialog.DialogButton dialogButton) {
            finish();
            Inventory.getInstance().add(reward_word.name, 1, false);
            Bank.getInstance().credit(reward_coins);
            game.session.addExperience(reward_points);
            GameSounds.play(GameSounds.COLLECT);
            dialog.close();
            unregisterTouchArea(dialog);
        }
    });

    String counts = String.format("%1$d/%2$d", this.winnings.size(), this.max_rounds);
    Text reward_text = new Text(reward_dialog.getWidth()/2, reward_dialog.getHeight()-24, GameFonts.dialogText(), counts, counts.length(),  new TextOptions(AutoWrap.WORDS, reward_dialog.getWidth()*0.8f, HorizontalAlign.CENTER), PhoeniciaContext.vboManager);
    reward_text.setColor(Color.GREEN);
    reward_dialog.attachChild(reward_text);

    ITiledTextureRegion sprite_region = this.game.wordSprites.get(reward_word);
    Sprite reward_sprite = new Sprite(reward_dialog.getWidth()/2, reward_dialog.getHeight() - 100, sprite_region.getTextureRegion(1), PhoeniciaContext.vboManager);
    reward_dialog.attachChild(reward_sprite);

    ITextureRegion coinRegion = GameUI.getInstance().getCoinsIcon();
    Sprite coinIcon = new Sprite(reward_dialog.getWidth()/2 - 32, 112, coinRegion, PhoeniciaContext.vboManager);
    coinIcon.setScale(0.5f);
    reward_dialog.attachChild(coinIcon);

    Text iconDisplay = new Text(reward_dialog.getWidth()/2 + 32, 112, GameFonts.dialogText(), String.valueOf(reward_coins), 10, new TextOptions(HorizontalAlign.LEFT), PhoeniciaContext.vboManager);
    reward_dialog.attachChild(iconDisplay);

    this.registerTouchArea(reward_dialog);
    reward_dialog.open(this);
    GameSounds.play(GameSounds.COMPLETE);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:41,代码来源:ImageMatchGameHUD.java

示例11: fail

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
private void fail(Word word) {
    //TODO: count failure
    Debug.d("wordmatch: fail!");
    GameSounds.play(GameSounds.FAILED);
    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite missed_sprite = new Sprite(this.cardPane.getWidth()/2, this.cardPane.getHeight() - 300, sprite_region.getTextureRegion(2), PhoeniciaContext.vboManager);
    this.resultsPane.attachChild(missed_sprite);
    missed_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, 300, 80),
            new MoveXModifier(0.5f, this.resultsPane.getWidth()/2, 48+(this.result_number*80))
            ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:15,代码来源:WordMatchGameHUD.java

示例12: WordSprite

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
/**
 * Construct a new LetterSprite
 * @param pX the X coordinate of the scene to place this LetterSprite
 * @param pY the Y coordinate of the scene to place this LetterSprite
 * @param word the locale Word this sprite will represent
 * @param count how many you have
 * @param needed how many you need
 * @param region the ITextureRegion containing the tiles for this letter
 * @param vbo the game's VertexBufferObjectManager
 */
public WordSprite(float pX, float pY, Word word, int count, int needed, ITiledTextureRegion region, VertexBufferObjectManager vbo) {
    super(pX, pY, region, vbo);
    this.word = word;
    this.count = count;
    this.needed = needed;

    this.count_text = new Text(32, -10, GameFonts.inventoryCount(), "", 8, new TextOptions(HorizontalAlign.CENTER), vbo);
    this.setCount(count);
    this.attachChild(count_text);

}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:22,代码来源:WordSprite.java

示例13: Numberpad

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
public Numberpad(final float pX, final float pY, final float width, final float height, final PhoeniciaGame game) {
    super(pX, pY, width, height);
    this.game = game;

    /**
     * Start available numbers area
     */
    final int columns = 5;
    float startX = 50;

    int offsetX = 0;
    int offsetY = (int) height-32;

    for (int i = 0; i < game.locale.numbers.size(); i++) {
        if (offsetX >= columns) {
            offsetY -= 80;
            offsetX = 0;
        }
        final Number currentNumber = game.locale.numbers.get(i);
        Debug.d("Adding Numberpad number: " + currentNumber.name + " (column: " + offsetX + ")");
        final ITiledTextureRegion blockRegion = game.numberSprites.get(currentNumber);
        final ButtonSprite block = new ButtonSprite(startX + (96 * offsetX), offsetY, blockRegion, PhoeniciaContext.vboManager);
        block.setOnClickListener(new ButtonSprite.OnClickListener() {
            @Override
            public void onClick(ButtonSprite buttonSprite, float v, float v2) {
                if (listener != null) {
                    listener.onKeyClicked(currentNumber);
                }
            }
        });
        this.registerTouchArea(block);
        this.attachChild(block);

        offsetX++;
    }

}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:38,代码来源:Numberpad.java

示例14: MapBlockSprite

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
/**
 * Create a new PlacedBlockSprite.
 * @param pX the X coordinate of the scene to place this PlacedBlockSprite
 * @param pY the Y coordinate of the scene to place this PlacedBlockSprite
 * @param pTileId the index of first tile of the first animation set from pTiledTextureRegion
 * @param pTiledTextureRegion region containing the tile set for this PlacedBlockSprite
 * @param pVertexBufferObjectManager the game's VertexBufferObjectManager
 */
public MapBlockSprite(final PhoeniciaGame phoeniciaGame, final float pX, final float pY, final int pTileId, final ITiledTextureRegion pTiledTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager) {
    super(pX, pY, pTiledTextureRegion, pVertexBufferObjectManager);
    this.phoeniciaGame = phoeniciaGame;
    this.mTileId = pTileId;
    this.startTile = pTileId;
    this.setCurrentTileIndex(pTileId);

    this.clickDetector = new ClickDetector(this);
    this.holdDetector = new HoldDetector(this);
    this.holdDetector.setTriggerHoldMinimumMilliseconds(1000);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:20,代码来源:MapBlockSprite.java

示例15: LetterSprite

import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入依赖的package包/类
/**
 * Construct a new LetterSprite
 * @param pX the X coordinate of the scene to place this LetterSprite
 * @param pY the Y coordinate of the scene to place this LetterSprite
 * @param letter the locale Letter this sprite will represent
 * @param count how many you have
 * @param needed how many you need
 * @param region the ITextureRegion containing the tiles for this letter
 * @param vbo the game's VertexBufferObjectManager
 */
public LetterSprite(float pX, float pY, Letter letter, int count, int needed, ITiledTextureRegion region, VertexBufferObjectManager vbo) {
    super(pX, pY, region, vbo);
    this.letter = letter;
    this.count = count;
    this.needed = needed;

    this.count_text = new Text(32, -10, GameFonts.inventoryCount(), "", 8, vbo);
    this.setCount(count);
    this.attachChild(count_text);

}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:22,代码来源:LetterSprite.java


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