Java HorizontalAlign.LEFT属性代码示例

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


Java HorizontalAlign.LEFT属性代码示例

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

示例1: showPage

/**
 * Change the display to the specified IntroPage
 * @param page_index page to display
 */
private void showPage(int page_index) {
    Debug.d("Showing page: "+page_index);
    this.current_page = page_index;
    final String nextPage = level.intro.get(page_index).text;
    final TextOptions introTextOptions = new TextOptions(AutoWrap.WORDS, messageBox.getWidth()-64, HorizontalAlign.LEFT);
    final Text introPageText = new Text(messageBox.getWidth()/2 - 32, messageBox.getHeight()/2, GameFonts.introText(), nextPage, introTextOptions, PhoeniciaContext.vboManager);
    introPageText.setPosition(messageBox.getWidth() / 2, messageBox.getHeight() - (introPageText.getHeight() / 2));

    this.messageBox.setHeight(introPageText.getHeight() + 64);
    introPageText.setPosition(this.messageBox.getWidth() / 2 + 16, this.messageBox.getHeight() - (introPageText.getHeight() / 2));

    messageBox.detachChildren();
    messageBox.attachChild(introPageText);
    messageBox.attachChild(this.nextButton);

    game.playLevelSound(level.intro.get(page_index).sound, this);
} 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:21,代码来源:LevelIntroHUD.java

示例2: createHUD

private void createHUD() {
	mHUD = new HUD(); // create fixed HUD for static text display
	
	mTimeText = new Text(0, 0, mResourcesManager.mFontSmall, Phrases.getPossibleCharacters(Phrases.FIELD_TIME), new TextOptions(HorizontalAlign.LEFT), mVertexManager); // prepare memory with all possible chars
	mExclamation = new Text(0, 0, mResourcesManager.mFontBig, Phrases.getPossibleCharacters(Phrases.FIELD_EXCLAMATION), new TextOptions(HorizontalAlign.CENTER), mVertexManager); // prepare memory with all possible chars
	mScoreText = new Text(0, 0, mResourcesManager.mFontSmall, Phrases.getPossibleCharacters(Phrases.FIELD_SCORE), new TextOptions(HorizontalAlign.RIGHT), mVertexManager); // prepare memory with all possible chars
	mBottomText = new Text(0, 0, mResourcesManager.mFontSmall, Phrases.getPossibleCharacters(Phrases.FIELD_TAP_TO_LEAVE), new TextOptions(HorizontalAlign.CENTER), mVertexManager); // prepare memory with all possible chars
	updateScore();
	updateExclamation();
	updateText(mBottomText, Phrases.mEmpty, GameScreen.CAMERA_WIDTH/2, GameScreen.CAMERA_HEIGHT/3, TEXT_HALIGN_CENTER, TEXT_VALIGN_TOP);
	
	mHUD.attachChild(mTimeText);
	mHUD.attachChild(mExclamation);
	mHUD.attachChild(mScoreText);
	mHUD.attachChild(mBottomText);

	mCamera.setHUD(mHUD);
} 
开发者ID:delight-im,项目名称:NationSoccer,代码行数:18,代码来源:GameScene.java

示例3: showMessage

public void showMessage(Message message, MessageBox position, final boolean showNextButton, final MediaPlayer.OnCompletionListener listener) {
    String messageText = message.text;
    String messageSound = message.sound;

    this.messageBox.detachChildren();
    this.nextButton.setVisible(false);
    this.messageBox.attachChild(this.nextButton);

    this.positionMessageBox(position);
    this.displayText = new Text(this.messageBox.getWidth()/2+16, this.messageBox.getHeight()/2, GameFonts.introText(), messageText, messageText.length(), new TextOptions(HorizontalAlign.LEFT), PhoeniciaContext.vboManager);
    this.displayText.setAutoWrapWidth(this.messageBox.getWidth() - 32);
    this.displayText.setAutoWrap(AutoWrap.WORDS);

    this.messageBox.setHeight(this.displayText.getHeight() + 64);
    this.displayText.setPosition(this.messageBox.getWidth() / 2 + 16, this.messageBox.getHeight() - (this.displayText.getHeight() / 2));

    this.messageBox.attachChild(this.displayText);
    if (messageSound != null && messageSound.length() > 0) {
        Debug.d("Playing tour message sound: '" + messageSound + "'");
        this.messagePlaying = true;
        this.game.playLevelSound(messageSound, new MediaPlayer.OnCompletionListener() {
            @Override
            public void onCompletion(MediaPlayer mp) {
                messagePlaying = false;
                if (listener != null) {
                    listener.onCompletion(mp);
                }
                if (showNextButton) {
                    nextButton.setVisible(true);
                }
            }
        });
    }


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

示例4: show_reward

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,代码行数:40,代码来源:ImageMatchGameHUD.java

示例5: attach

@Override
public void attach(Scene scene, VertexBufferObjectManager vertexBufferObjectManager) {
	text = new Text (getX(),getY(),font,String.format(format, value),15,new TextOptions(HorizontalAlign.LEFT),vertexBufferObjectManager);
	text.setAnchorCenterX(0);
	text.setPosition(getX()-text.getWidth()/2, getY());
	scene.attachChild(text);
} 
开发者ID:mmlevin,项目名称:secu3droid,代码行数:7,代码来源:GaugeDigital.java

示例6: TextOptions

public TextOptions() {
	this(AutoWrap.NONE, 0, HorizontalAlign.LEFT, Text.LEADING_DEFAULT);
} 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:3,代码来源:TextOptions.java

示例7: TickerTextOptions

public TickerTextOptions(final float pCharactersPerSecond, final boolean pReverse) {
	this(HorizontalAlign.LEFT, pCharactersPerSecond, pReverse);
} 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:3,代码来源:TickerText.java

示例8: Character

public Character() {
	
	ITextureRegion characterITR;
	if (character == "Ryoko") {
		characterITR = ResourceManager.getInstance().characterProfileRyoko;
		name = ResourceManager.getInstance().loadAndroidRes().getString(R.string.profile_ryoko_name);
		name_jp = ResourceManager.getInstance().loadAndroidRes().getString(R.string.profile_ryoko_name_jap);
		info = ResourceManager.getInstance().loadAndroidRes().getString(R.string.profile_ryoko_info);
       }
       else {
       	characterITR = ResourceManager.getInstance().characterProfileSho;
                 name = ResourceManager.getInstance().loadAndroidRes().getString(R.string.profile_sho_name);
		name_jp = ResourceManager.getInstance().loadAndroidRes().getString(R.string.profile_sho_name_jap);
		info = ResourceManager.getInstance().loadAndroidRes().getString(R.string.profile_sho_info);
       }
	
	sprite = new Sprite(spritePosX, spritePosY, characterITR, ResourceManager.getInstance().engine.getVertexBufferObjectManager());
	sprite.setScale(spriteScaleAdjustment);
	attachChild(sprite);
	
	nameT = new Text(
			SCRNWIDTH * 0.5f,
			SCRNHEIGHT * 0.5f,
               ResourceManager.getInstance().fontLatinChrName, name,
               new TextOptions(HorizontalAlign.CENTER),
               ResourceManager.getInstance().engine
               .getVertexBufferObjectManager());
	nameT.setPosition(namePosX, namePosY);
	attachChild(nameT);
	
	name_jpT = new Text(
			SCRNWIDTH * 0.5f,
			SCRNHEIGHT * 0.5f,
               ResourceManager.getInstance().fontJPChrName, name_jp,
               new TextOptions(HorizontalAlign.CENTER),
               ResourceManager.getInstance().engine
               .getVertexBufferObjectManager());
	name_jpT.setPosition(name_jpPosX, name_jpPosY);
	attachChild(name_jpT);
	
	infoT = new Text(
			SCRNWIDTH * 0.5f,
			SCRNHEIGHT * 0.5f,
               ResourceManager.getInstance().fontLatinChrInfo, info,
               new TextOptions(HorizontalAlign.LEFT),
               ResourceManager.getInstance().engine
               .getVertexBufferObjectManager());
	infoT.setPosition(infoPosX, infoPosY);
	attachChild(infoT);
	
} 
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:51,代码来源:CharacterIntroScene.java

本文标签属性:

示例:示例英文

代码:代码零九

java:javascript什么意思

HorizontalAlign:horizontalalignment参数

LEFT:left join

上一篇:袁今夏的原型是谁(袁今夏真实身份)
下一篇:Java BanList类代码示例

为您推荐