本文整理汇总了Java中org.andengine.entity.scene.Scene类的典型用法代码示例。如果您正苦于以下问题:Java Scene类的具体用法?Java Scene怎么用?Java Scene使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Scene类属于org.andengine.entity.scene包,在下文中一共展示了Scene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showGiftRequestCode
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
public void showGiftRequestCode() {
final GiftStop stop = this;
this.giftRequest = GiftRequest.newRequest(this.tour.game, this.requestWord, this.tourRequest);
this.requestHUD = new RequestGiftHUD(this.tour.game, this.giftRequest) {
@Override
protected boolean verifyGift() {
// don't verify anything yet
return false;
}
};
this.requestHUD.setNumberpadVisible(false);
this.overlay.setManagedHUD(this.requestHUD, new IOnSceneTouchListener() {
@Override
public boolean onSceneTouchEvent(Scene scene, TouchEvent touchEvent) {
// Capture scene touches
stop.next();
return false;
}
});
this.overlay.showMessage(this.getMessage(MSG_REQUESTCODE), TourOverlay.MessageBox.Bottom, true);
}
示例2: showDeleteConfirm
import org.andengine.entity.scene.Scene; //导入依赖的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);
}
示例3: onPopulateScene
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public void onPopulateScene(final Scene pScene, final OnPopulateSceneCallback pOnPopulateSceneCallback) {
this.runOnUiThread(new Runnable() {
@Override
public void run() {
ActivityUtils.doProgressAsync(SimpleAsyncGameActivity.this, "Populating Scene...", android.R.drawable.ic_menu_rotate, new ProgressCallable<Void>() {
@Override
public Void call(final IProgressListener pProgressListener) throws Exception {
SimpleAsyncGameActivity.this.onPopulateSceneAsync(pScene, pProgressListener);
pProgressListener.onProgressChanged(100);
pOnPopulateSceneCallback.onPopulateSceneFinished();
return null;
}
}, new Callback<Void>() {
@Override
public void onCallback(final Void pCallbackValue) {
/* Nothing. */
}
});
}
});
}
示例4: onPopulateScene
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public void onPopulateScene(final Scene pScene, final OnPopulateSceneCallback pOnPopulateSceneCallback) {
this.runOnUiThread(new Runnable() {
@Override
public void run() {
ActivityUtils.doProgressAsync(SimpleAsyncGameActivity.this, "Populating Scene...", android.R.drawable.ic_menu_rotate, new ProgressCallable<Void>() {
@Override
public Void call(final IProgressListener pProgressListener) throws Exception {
SimpleAsyncGameActivity.this.onPopulateSceneAsync(pScene, pProgressListener);
pProgressListener.onProgressChanged(100);
pOnPopulateSceneCallback.onPopulateSceneFinished();
return null;
}
}, new Callback<Void>() {
@Override
public void onCallback(final Void pCallbackValue) {
/* Nothing. */
}
});
}
});
}
示例5: prepareScene
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public Scene prepareScene() {
Scene scene = activity.getScene();
final Background backgroundColor = new Background(0.84706f, 0.64706f, 0.84314f);
scene.setBackground(backgroundColor);
resetGamePoints();
createCards();
scene.setTouchAreaBindingOnActionDownEnabled(true);
TimerHandler myTimer = new TimerHandler(1, true, new ITimerCallback() {
public void onTimePassed(TimerHandler pTimerHandler) {
decrementTime();
}
});
scene.registerUpdateHandler(myTimer);
return scene;
}
示例6: onCreateScene
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public void onCreateScene(final OnCreateSceneCallback pOnCreateSceneCallback) {
this.runOnUiThread(new Runnable() {
@Override
public void run() {
ActivityUtils.doProgressAsync(SimpleAsyncGameActivity.this, "Loading Scene...", android.R.drawable.ic_menu_rotate, new ProgressCallable<Void>() {
@Override
public Void call(final IProgressListener pProgressListener) throws Exception {
final Scene scene = SimpleAsyncGameActivity.this.onCreateSceneAsync(pProgressListener);
pProgressListener.onProgressChanged(100);
pOnCreateSceneCallback.onCreateSceneFinished(scene);
return null;
}
}, new Callback<Void>() {
@Override
public void onCallback(final Void pCallbackValue) {
/* Nothing. */
}
});
}
});
}
示例7: onCreateScene
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
protected Scene onCreateScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());
initSplashScene();
Log.d(TAG, "onCreateScene - Splash Scene created.");
loadMenus();
initMenuPause();
initMenuWin();
updateNextStatus();
Log.d(TAG, "onCreateScene - Splash Scene created.");
loadGameAsync();
return splashScene;
}
示例8: getOnSceneTouchListener
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public IOnSceneTouchListener getOnSceneTouchListener() {
return new IOnSceneTouchListener() {
@Override
public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) {
final int action = pSceneTouchEvent.getAction();
if (action == TouchEvent.ACTION_MOVE || action == TouchEvent.ACTION_DOWN) {
final Body body = player.getBody();
float ratio = PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT;
body.setTransform(body.getPosition().x, pSceneTouchEvent.getY() / ratio, body.getAngle());
return true;
}
return false;
}
};
}
示例9: setGameScene
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
private void setGameScene() {
gameScene = new Scene();
gameScene.setOnAreaTouchTraversalFrontToBack();
final IOnSceneTouchListener sceneTouchListener = currentGame.getOnSceneTouchListener();
if (sceneTouchListener != null) {
gameScene.setOnSceneTouchListener(sceneTouchListener);
}
loadPhysics(currentGame);
for (int i = 0; i < LAYER_COUNT; i++) {
final Entity layer = new Entity();
layer.setZIndex(i);
gameScene.attachChild(layer);
}
loadHUD(currentGame);
loadScene(currentGame);
mEngine.setScene(gameScene);
MusicManager.pause();
music.play();
}
示例10: onCreateScene
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
protected Scene onCreateScene() {
Logger.log(TAG, "onCreateScene");
Scene scene = new Scene();
ITexture background = mResources.getTexture("background.jpg");
ITextureRegion region = TextureRegionFactory.extractFromTexture(background);
Logger.log(TAG, "region: x - " + region.getTextureX() + "; y - " + region.getTextureY() +
"; width - " + region.getWidth() + "; height - " + region.getHeight());
Sprite backgroundSprite = new Sprite(CAMERA_WIDTH / 2, CAMERA_HEIGHT / 2, region, getVertexBufferObjectManager());
scene.attachChild(backgroundSprite);
ITexture fish = mResources.getTexture("fish.png");
ITextureRegion fishRegion = TextureRegionFactory.extractFromTexture(fish);
Sprite fishSprite = new Sprite(CAMERA_WIDTH / 2, CAMERA_HEIGHT / 2, fishRegion, getVertexBufferObjectManager());
scene.attachChild(fishSprite);
return scene;
}
示例11: deleteCard
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
private void deleteCard(Card card, boolean shouldRemove, boolean didUnregisteredTouchArea) {
final Scene scene = activity.getScene();
final Sprite back = card.getBack();
card.setVisible(false);
back.setVisible(false);
if (didUnregisteredTouchArea) {
scene.unregisterTouchArea(card);
}
if (shouldRemove) {
cards.remove(card);
}
scene.getChildByIndex(PortraitGameActivity.LAYER_FOREGROUND).detachChild(card);
scene.getChildByIndex(PortraitGameActivity.LAYER_FOREGROUND).detachChild(back);
}
示例12: open
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
public void open(Scene target) {
Debug.d("Opening dialog on "+target);
this.openOn = target;
//this.openOn.centerEntityInCamera(this);
//this.setPosition(target.getCamera().getWidth()/2, target.getCamera().getHeight()/2);
//this.setZIndex(target.getZIndex()+100);
this.openOn.attachChild(this);
}
示例13: Bird
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
public Bird(float birdXOffset, float birdYOffset, VertexBufferObjectManager mVertexBufferObjectManager, Scene mScene) {
this.mBirdXOffset = birdXOffset;
this.mBirdYOffset = birdYOffset;
mSprite = new AnimatedSprite(mBirdXOffset, mBirdYOffset, 55.8f, 40, mBirdTextureRegion, mVertexBufferObjectManager);
mSprite.setColor(Color.YELLOW);
mSprite.animate(115);
mSprite.setZIndex(2);
mScene.attachChild(mSprite);
}
示例14: attachildAndRegisterButtons
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
public void attachildAndRegisterButtons(Scene scene){
this.attachChild(notebookTitle);
for(int i=0;i<11;i++){
this.attachChild(buttonScoreSprites[i]);
scene.registerTouchArea(buttonScoreSprites[i]);
}
this.attachChild(left);
this.attachChild(right);
left.setOnClickListener(this);
right.setOnClickListener(this);
scene.registerTouchArea(left);
scene.registerTouchArea(right);
}
示例15: createItem
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
private void createItem(float posX, float posY, ITiledTextureRegion textureRegion, Item.Type type) {
Item item = new Item(type, textureRegion, posX, posY, this);
items.add(item);
final Scene gameScene = activity.getScene();
final IEntity layerBG = gameScene.getChildByIndex(PortraitGameActivity.LAYER_BACKGROUND);
final TouchableAnimatedSprite sprite = item.getSprite();
sprite.setVisible(true);
layerBG.attachChild(sprite);
layerBG.attachChild(item.getShape());
gameScene.registerTouchArea(item.getShape());
}