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


Java ITiledTextureRegion.getTextureRegion方法代码示例

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


在下文中一共展示了ITiledTextureRegion.getTextureRegion方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例7: 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

示例8: 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

示例9: 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


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