andengine

andengine activity bg not fit the screen

时间秒杀一切 提交于 2019-12-10 15:41:53
问题 I have set bg for the menu page in my simple game developing using andengine. I have Set the bg as public class MenuActivity extends SimpleBaseGameActivity implements IOnMenuItemClickListener { private static int CAMERA_WIDTH = 480; private static int CAMERA_HEIGHT = 800; private Camera mCamera; private ITextureRegion mBackgroundTextureRegion; protected static final int MENU_RESET = 0; protected static final int MENU_QUIT = MENU_RESET + 1; private Font mFont; protected MenuScene mMenuScene;

SimpleLevelLoader class not found in AndEngine GLES2

醉酒当歌 提交于 2019-12-10 13:16:13
问题 Am new in AndEngine. While working from a AndEngine Tutorial , following classes are not found. I tried with importing all libraries from AndEngine but class are still not found. Classes are : SimpleLevelLoader EntityLoader SimpleLevelEntityLoaderData Please help me how to fix this. 回答1: After spending few hours finally I got the issue. Actually I was using GLES2 which has no such classes . For those classes we need GLES2-AnchorCenter , which is latest update from AndEngine. I only replaced

How to override onSetContentView while Using Ratio Resolution policy in Andengine Base game activity

一曲冷凌霜 提交于 2019-12-10 12:58:19
问题 I am developing (learning to build :) a game with andengine GLES2 . I am using Base game activity , and I override the setContent view to place my admob ad. Everything works fine except the resolution policy. Ratio Resolution policy is the one I am using along with CAMERA_WIDTH = 800; and CAMERA_HEIGHT = 480; The issue is that whenever overridden, the onsetContentView scene is not getting aligned to the center and margins are displayed only on the bottom and not on both: top and bottom. Same

Drawing Line Effect on Touch Like Fruit Ninja or Veggie Samurai in And Engine

孤街浪徒 提交于 2019-12-10 11:59:29
问题 I want to draw a line in AndEngine with the effect of a blade similar to Fruit Ninja or Veggie Samurai. Can anyone help me? and give a sample code? 回答1: Maybe, I am late but hope this will help others. @Override public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) { final float touchX = pSceneTouchEvent.getX(); final float touchY = pSceneTouchEvent.getY(); if (pSceneTouchEvent.isActionDown()) { initTrail(touchX, touchY); swipeGestureSprite = addSwipeSprite(touchX,

Library andenginephysicsbox2dextension not found

我怕爱的太早我们不能终老 提交于 2019-12-10 11:58:56
问题 I have used the andengine.jar file in our application. I have run the physicsexample. But it shows error Library andenginephysicsbox2dextension not found. Is there any solution to remove this error. 回答1: I believe you should not use andengine.jar. Instead fetch the source code from repository. See this thread on AndEngine forums: http://www.andengine.org/forums/announces/andengine-gles2-pre-release-on-december-23rd-t6097.html You will need to get AndEngine and the extensions you wish to use.

Box2D AndEngine: app hangs out when creating Joints during ContactListener?

…衆ロ難τιáo~ 提交于 2019-12-10 11:33:00
问题 I am using Box2D in AndEngine (for Android). My purpose is to create a Force joint whenever 2 objects collide with each other. When I try to create a Mouse Joint between 2 objects (bodies) during ContactListner process. The application will hang for some time then exit, without any error, just a notification of threads ending. The Joint creating is OK when I call mEnvironment.CreateForceJoint(..) outside the ContactListener - somewhere while app is running in some physics.UpdateHandler().

AndEngine - Sprites are not getting scaled on different devices

不想你离开。 提交于 2019-12-10 11:19:37
问题 Code : This is how m initializing camera. I', trying to get resolution of device and based on that i set camera width and height. public class GameActivity extends SimpleBaseGameActivity { private SmoothCamera mCamera; private DisplayMetrics dM; private int CAMERA_WIDTH, CAMERA_HEIGHT; private double ScreenWidth, ScreenHeight, resolutionRatio; public EngineOptions onCreateEngineOptions() { //set Camera getDeviceResolution(); setCamera(); EngineOptions options = new EngineOptions(true,

AndEngine MenuScene - can't click on Button

爷,独闯天下 提交于 2019-12-10 10:42:47
问题 I have a small problem with android & andengine. This is my source code of my main menu // AbstractScene is extending Scene public class MainMenuScene extends AbstractScene implements IOnMenuItemClickListener { private static final int MENU_CREATE = 10; private static final int MENU_JOIN = 20; private static final int MENU_ABOUT = 30; private static final int MENU_SETTINGS = 40; MenuScene scene; @Override public void loadResources() { res.loadMenuResources(); } @Override public void create()

How do I make a “Hello World” with andEngine inside Android Studio on a Mac

自闭症网瘾萝莉.ら 提交于 2019-12-10 10:38:45
问题 I have tried a lot of tutorials and they are fairly complicated to follow or partly irrelevant now. How do I make a Hello World for Android using andEngine and Android Studio on a Mac? 回答1: This is my experience as of Android Studio v1.0 on a Macintosh to setup a Hello World example. (Although it's a blue background.) Goto https://github.com/nicolasgramlich/AndEngine and clone in desktop. Create a new library by going to File -> Project Structure (⌘;) then selecting the + button on the upper

Queue multiple entity modifiers in AndEngine

跟風遠走 提交于 2019-12-10 10:28:50
问题 I'm trying to have a sprite ("pointer" below) along two paths, one after the other. Here is my code: scene.attachChild(pointer); pointer.clearEntityModifiers(); pointer.registerEntityModifier(new MoveModifier( 1.0f, 540, 960, 1000, 1000, new IEntityModifierListener() { public void onModifierStarted(IModifier<IEntity> pModifier, IEntity pItem) {} public void onModifierFinished(IModifier<IEntity> pModifier, IEntity pItem) { clickSound.play(); pointer.clearEntityModifiers(); pointer