import org.andengine.util.adt.align.HorizontalAlign; //導入依賴的package包/類public void showDeleteConfirm(final SessionSprite sessionSprite) { final Scene scene = this; Dialog confirmDelete = new Dialog(400, 200, Dialog.Buttons.YES_NO, PhoeniciaContext.vboManager, new Dialog.DialogListener() { @Override public void onDialogButtonClicked(Dialog dialog, Dialog.DialogButton dialogButton) { if (dialogButton == Dialog.DialogButton.YES) { Debug.d("delete session"); deleteSession(sessionSprite); } else { Debug.d("Don't delete session"); } dialog.close(); scene.unregisterTouchArea(dialog); } }); confirmDelete.attachChild(new Text(200, 150, GameFonts.dialogText(), "delete saved game?", 18, new TextOptions(HorizontalAlign.CENTER), PhoeniciaContext.vboManager)); scene.registerTouchArea(confirmDelete); confirmDelete.open(scene);}
import org.andengine.util.adt.align.HorizontalAlign; //導入依賴的package包/類private void show_sorry() { Dialog sorry_dialog = new Dialog(400, 150, Dialog.Buttons.OK, PhoeniciaContext.vboManager, new Dialog.DialogListener() { @Override public void onDialogButtonClicked(Dialog dialog, Dialog.DialogButton dialogButton) { dialog.close(); unregisterTouchArea(dialog); finish(); } }); String counts = String.format("%1$d/%2$d", this.winnings.size(), this.max_rounds); Text sorry_text = new Text(sorry_dialog.getWidth()/2, sorry_dialog.getHeight()-48, GameFonts.dialogText(), counts, counts.length(), new TextOptions(AutoWrap.WORDS, sorry_dialog.getWidth()*0.8f, HorizontalAlign.CENTER), PhoeniciaContext.vboManager); sorry_text.setColor(Color.RED); sorry_dialog.attachChild(sorry_text); this.registerTouchArea(sorry_dialog); sorry_dialog.open(this); GameSounds.play(GameSounds.FAILED);}
import org.andengine.util.adt.align.HorizontalAlign; //導入依賴的package包/類/** * 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);}
import org.andengine.util.adt.align.HorizontalAlign; //導入依賴的package包/類public DormidaSprite() { super(GameActivity.WORLD_WIDTH / 2, GameActivity.WORLD_HEIGHT / 2, ResourceManager.getInstance().NOTE_BOOK_EMPTY_TEXTURE_REGION, ResourceManager.getInstance().getVertexBuffer()); this.setY(GameActivity.WORLD_HEIGHT + this.getHeight() / 2); float posY = 100; winnerTitle = new Text((this.getWidth()/2)+30,this.getHeight()-posY, ResourceManager.getInstance().fontBig,"123456789",20, new TextOptions(HorizontalAlign.CENTER),ResourceManager.getInstance().getVertexBuffer()); winnerTitle.setText(ResourceManager.getInstance().context.getString(R.string.dormida)); winnerTitle.setColor(0.25490196f, 0.25490196f, 0.25490196f); winnerTitle.setScale(0.7f); this.attachChild(winnerTitle); posY += 120; winnerPlayer = new Text((this.getWidth()/2)+30,this.getHeight()-posY, ResourceManager.getInstance().fontNormal,"123456789",20, new TextOptions(HorizontalAlign.CENTER),ResourceManager.getInstance().getVertexBuffer()); this.attachChild(winnerPlayer); this.setVisible(false);}
import org.andengine.util.adt.align.HorizontalAlign; //導入依賴的package包/類protected float getMenuItemX(final MenuScene pMenuScene, final int pIndex) {final float menuSceneWidth = pMenuScene.getWidth();final IMenuItem menuItem = pMenuScene.getMenuItem(pIndex);final float menuItemWidth = menuItem.getWidth();/* Determine horizontal position. */final float x;switch (this.mHorizontalAlign) {case LEFT:x = menuItemWidth * 0.5f;break;case CENTER:x = menuSceneWidth * 0.5f;break;case RIGHT:x = menuSceneWidth - (menuItemWidth * 0.5f);break;default:throw new IllegalArgumentException("Unexpected " + HorizontalAlign.class.getSimpleName() + " with value: '" + this.mHorizontalAlign + "'.");}return x + this.mOffsetX;}
本文由 貴州做網站公司 整理發布,部分圖文來源于互聯網,如有侵權,請聯系我們刪除,謝謝!
網絡推廣與網站優化公司(網絡優化與推廣專家)作為數字營銷領域的核心服務提供方,其價值在于通過技術手段與策略規劃幫助企業提升線上曝光度、用戶轉化率及品牌影響力。這...
在當今數字化時代,公司網站已成為企業展示形象、傳遞信息和開展業務的重要平臺。然而,對于許多公司來說,網站建設的價格是一個關鍵考量因素。本文將圍繞“公司網站建設價...
在當今的數字化時代,企業網站已成為企業展示形象、吸引客戶和開展業務的重要平臺。然而,對于許多中小企業來說,高昂的網站建設費用可能會成為其發展的瓶頸。幸運的是,隨...
matlab中size函數怎么使用?1. 在我們的電腦上打開matlab,添加一個4行3列的矩陣a,如下圖所示:2 Y=size(a),按enter鍵,可以看到Y的結果是4和3,這意味著當size()函數只有一個輸入參數時,它返回矩陣的行和列,如下圖所示:3。在命令行窗口中輸入Y1=size(a,1),按Enter鍵,可以看到Y的結果是矩陣的行數,如下圖所示:4。在命令行窗口中輸入y2=size(...
Cf綠色聯盟怎么退?聽說退了會封號?你好,LZ。CF綠色聯盟can 不要放棄。我建議既不退出也不開G,如果LZ堅持退出,可以開G,封了就自動退出。只會封半年,就看LZ有沒有耐心了。我再提醒你一次,如果你打開它,它被封了,你覺得你能找到什么樣的解封者?這樣肯定不行。這些都是騙人的。;的錢。cf綠色聯盟怎么退出?成功加入綠色聯盟,過一段時間想退出怎么辦?打開CF官網綠色聯盟的網頁,點擊退出綠色聯盟。...
超級牛聽如何重新設置網絡?牛聽聽換了wifi之后的系統設置方法。首次識別牛聽聽,再點百度主頁的未手機綁定熏教機,再點擊添加一欄,選著牛聽一下型號windows版或便攜版。按顯示然后輸入下的無線網帳號及登錄密碼。按一下牛聽一下身側的wlan鍵,此時牛聽聽會震動提示結束網路配置如何,牛再聽聽正面的無線網顯示燈紅色閃爍。左鍵單擊停止配置好不好后,將諾基亞手機東面牛去聽聽的錄音鍵。fast無線接收器怎么使...