public SplashScene() { setBackground(new Background(Color.RED)); activity = BaseActivity.getSharedInstance(); Text title1 = new Text(0, 0, activity.mFont, "Blankwall", activity.getVertexBufferObjectManager()); Text title2 = new Text(0, 0, activity.mFont, "Productions", activity.getVertexBufferObjectManager()); title1.setPosition(-title1.getWidth(), activity.mCamera.getHeight() / 2); title2.setPosition(activity.mCamera.getWidth(), activity.mCamera.getHeight() / 2); attachChild(title1); attachChild(title2); title1.registerEntityModifier( new MoveXModifier(1, title1.getX(), activity.mCamera.getWidth() / 2 - title1.getWidth())); title2.registerEntityModifier( new MoveXModifier(1, title2.getX(), activity.mCamera.getWidth() / 2)); loadResources(); }
@Override public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback) throws Exception { manager.LoadSplash(this, this.mEngine); Font font = manager.mSplashFont; // Ajout du titre mTitle1 = new Text(0, 0, font, this.getString(R.string.titre1), this.getVertexBufferObjectManager()); mTitle2 = new Text(0, 0, font, this.getString(R.string.titre2), this.getVertexBufferObjectManager()); mTitle1.setPosition(-mTitle1.getWidth(), mCamera.getHeight() - 125); mTitle2.setPosition(mCamera.getWidth(), mCamera.getHeight() - 125); // Ajout de la modification du titre mTitle1.registerEntityModifier( new MoveXModifier(1f, mTitle1.getX(), mCamera.getWidth() / 2 - mTitle1.getWidth() - 18)); mTitle2.registerEntityModifier( new MoveXModifier(1f, mTitle2.getX(), mCamera.getWidth() / 2 - 18)); pOnCreateResourcesCallback.onCreateResourcesFinished(); }
private void addMessage(final String pMessage) { final Text messageText = new Text( 0, 0, mFont, pMessage, MAXIMUM_CHARACTERS_PER_LINE, new TextOptions(HorizontalAlign.LEFT), mVertexBufferObjectManager); messageText.setAlpha(0.8f); for (Text text : this.mChatMessages) { text.setPosition(text.getX(), text.getY() - messageText.getHeight()); } messageText.setPosition( TEXT_PADDING_X, this.getHeight() - (messageText.getHeight() + TEXT_PADDING_Y)); this.mChatMessages.add(messageText); this.attachChild(messageText); }