本文整理汇总了Java中org.andengine.entity.scene.Scene类的典型用法代码示例。如果您正苦于以下问题:Java Scene类的具体用法?Java Scene怎么用?Java Scene使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Scene类属于org.andengine.entity.scene包,在下文中一共展示了Scene类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:23,代码来源:GiftStop.java
示例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);
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:20,代码来源:SessionSelectionScene.java
示例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. */
}
});
}
});
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:26,代码来源:SimpleAsyncGameActivity.java
示例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. */
}
});
}
});
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:26,代码来源:SimpleAsyncGameActivity.java
示例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;
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:21,代码来源:PictoGame.java
示例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. */
}
});
}
});
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:26,代码来源:SimpleAsyncGameActivity.java
示例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;
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:17,代码来源:AbstractGameActivity.java
示例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;
}
};
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:17,代码来源:GutGame.java
示例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();
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:22,代码来源:AbstractGameActivity.java
示例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;
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:19,代码来源:GameActivity.java
示例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);
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:17,代码来源:PictoGame.java
示例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);
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:9,代码来源:Dialog.java
示例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);
}
开发者ID:sunnyshah2894,项目名称:Flappy-Guy,代码行数:13,代码来源:Bird.java
示例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);
}
开发者ID:viniciusDSL,项目名称:One-Cachito,代码行数:14,代码来源:NoteBookSprite.java
示例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());
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:12,代码来源:BinGame.java
示例16: onSceneTouchEvent
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouchEvent) {
if (this.mSelectedMenuItem != null) {
this.mSelectedMenuItem.onUnselected();
this.mSelectedMenuItem = null;
}
return false;
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:MenuScene.java
示例17: onSceneTouchEvent
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouchEvent) {
final int pointerID = pSceneTouchEvent.getPointerID();
if (pointerID == this.mActivePointerID) {
this.onHandleControlBaseLeft();
switch (pSceneTouchEvent.getAction()) {
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
this.mActivePointerID = BaseOnScreenControl.INVALID_POINTER_ID;
}
}
return false;
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:15,代码来源:BaseOnScreenControl.java
示例18: onTouchEvent
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
@Override
public boolean onTouchEvent(final TouchEvent pSurfaceTouchEvent) {
/* Let the engine determine which scene and camera this event should be handled by. */
final Scene scene = this.getSceneFromSurfaceTouchEvent(pSurfaceTouchEvent);
final Camera camera = this.getCameraFromSurfaceTouchEvent(pSurfaceTouchEvent);
this.convertSurfaceTouchEventToSceneTouchEvent(camera, pSurfaceTouchEvent);
if (this.onTouchHUD(camera, pSurfaceTouchEvent)) {
return true;
} else {
/* If HUD didn't handle it, Scene may handle it. */
return this.onTouchScene(scene, pSurfaceTouchEvent);
}
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:16,代码来源:Engine.java
示例19: createBackground
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
private void createBackground(Scene scene) {
final SmoothCamera camera = activity.getCamera();
final VertexBufferObjectManager vbom = activity.getVBOM();
final ITiledTextureRegion texFlow = activity.getTexture(ResMan.GUT_FLOW);
final IEntity layerBG = scene.getChildByIndex(AbstractGameActivity.LAYER_BACKGROUND);
scene.setBackground(new SpriteBackground(new Sprite(0, 0, camera.getWidth(), camera.getHeight(),
activity.getTexture(ResMan.GUT_BG), vbom)));
for (int i = 0; i < 4; i++) {
layerBG.attachChild(new Flow(POS_FLOW[i], texFlow, vbom).getSprite());
}
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:14,代码来源:GutGame.java
示例20: createKey
import org.andengine.entity.scene.Scene; //导入依赖的package包/类
private void createKey(Base.Type type) {
Key key = new Key(type, this);
keyMap.put(type, key);
final Scene scene = activity.getScene();
final TouchableAnimatedSprite sprite = key.getSprite();
final TouchableAnimatedSprite shape = key.getShape();
final IEntity layerBG = scene.getChildByIndex(AbstractGameActivity.LAYER_FOREGROUND);
layerBG.attachChild(key.getShadowInvalid());
layerBG.attachChild(key.getShadowValid());
layerBG.attachChild(sprite);
layerBG.attachChild(shape);
scene.registerTouchArea(shape);
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:15,代码来源:PianoGame.java
注:本文中的org.andengine.entity.scene.Scene类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论