andengine

Can't load sprite in AndEngine

给你一囗甜甜゛ 提交于 2019-12-23 04:18:09
问题 I'm learning AndEngine and I'm following some basic tutorials. I tried to load an sprite in the screen, but the Sprite looks corrupted. This is my code: package com.example.andengine_demo; import org.andengine.engine.camera.Camera; import org.andengine.engine.options.EngineOptions; import org.andengine.engine.options.ScreenOrientation; import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; import org.andengine.entity.scene.Scene; import org.andengine.entity.scene

Disable collision completely of a body in AndEngine Box2D

牧云@^-^@ 提交于 2019-12-23 03:19:15
问题 I am working on a Bubble Shooter type game where I want a body not to collide with any thing else when its burst or falling down. I cant use collision filtering because all the bodies on the scene are of same type. I want to disable the collision. I don't want to collide a body with any other body.Some one told me to set the isSensor flag to true but again I am not able to get the flag and set it. Please help. 回答1: Found the answer: for(int i=0; i<getBody().getFixtureList().size();i++){ this

GL Maximum Textures Size Policy

安稳与你 提交于 2019-12-22 23:39:08
问题 I'm developing a game with AndEngine. Since I'm doing it for Android and I want to cover as many devices as possible without the textures quality trade off I have 2 texture packs types: the HD and the LOW: HD textures = 2048x2048 LOW textures= 1024x1024 HD camera = 800x1280 LOW camera = 400x640 I've have made all the logic of setting up a HD texture pack or a LOW texture pack, what I need now is a good policy for choosing witch to use when the app starts up. Using AndEngine's: GLState state =

How to decide width and height for SVG sprite in AndEngine

帅比萌擦擦* 提交于 2019-12-22 14:58:43
问题 I am using AndEngine to load a svg images as my Sprites. The problem I am having with this is that i can't figure out how to scale the image to fit the particular device on which it is being run. sprite= new Sprite(positionX, positionY, WIDTH,HEIGHT,TextureRegion); The parameters that it takes are the position's on x and y coordinates, and then width, and height. The problem I am having is that I can't figure out how to scale the sprite to the right width and height for how I want it. For

AndEngine - scroll sprites up and down

非 Y 不嫁゛ 提交于 2019-12-22 13:57:30
问题 I am a beginner andengine user and I need your help. I have created a class MySprite extending sprite and I want the sprite to move up and down on the y - coordinate when I slide with the finger on the Screen by touching only the sprite. I have tried to achieve this by implementing IScrollDetectorListener and IonSceneTouchListener but the Problem is: I can touch anywhere and my sprites moves. I would be glad if someone could help. For more Details just comment :) 回答1: Sprite mySprite = new

how to move body of sprite using andEngine?

試著忘記壹切 提交于 2019-12-21 21:34:09
问题 I want to move body of the sprite along with line in some portion of line, just i able to move sprite only but body is not moving. public Scene onLoadScene() { this.mEngine.registerUpdateHandler(new FPSLogger()); final Scene scene = new Scene(2); scene.setBackground(new ColorBackground(0.09804f, 0.00274f, 0.0784f)); this .enableAccelerometerSensor(this ); this.sPhysicsWorld = new PhysicsWorld(new Vector2(0, SensorManager.GRAVITY_EARTH), false); final Shape ground = new Rectangle(0, CAMERA

Screen Capture in andengine gives upside down mirror image

纵然是瞬间 提交于 2019-12-21 16:17:08
问题 In my situation i haven't use RenderSurfaceView. I want to take a screen capture of my scene. But when i save the screen shot it shows upside down mirror image. Cant understand what im doing wrong here. Here is my code attachChild(screenCapture); share_clicked = 1; final int viewWidth = (int)camera.getWidth(); final int viewHeight = (int)camera.getHeight(); Log.d("camera width", "View width :" + viewWidth); Log.d("camera height", "View height :" + viewHeight); File direct = new File(

eglSwapBuffers failed: EGL_BAD_ALLOC AndEngine Android

与世无争的帅哥 提交于 2019-12-21 02:26:25
问题 I m developing a game in And engine which throws the exception. Actually I don't know the point where exceptions occurs. It is reported in market many many time. java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1080) at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1038) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1364) at android.opengl.GLSurfaceView

Fatal signal 11 (andengine project)

风格不统一 提交于 2019-12-20 06:24:07
问题 I'm creating and android game powered by andengine framework the box2d extension I'm getting "Fatal Signal 11" which seems to happen out of nowhere (I guess you can call it randomly) there no clues (at least, I don't aware to any clues to help me solve this problem) my guesses are: 1) I'm creating game's entities using TimerTask class 2) maybe it has something to do with concurrency? what do you think? thanks, socksocket 回答1: You could still use a TimerTask, you just need to be sure to call

Custom ScrollView in andengine

风格不统一 提交于 2019-12-20 04:25:15
问题 How can I make a custom ScrollView which moves all the sides. And how do I also find the position where I tapped the ScrollView in andengine ? Thanks in advance. 回答1: I wrote a small ShapeScrollContainer.java class which is a work in progress but is functional and you are welcome to use, https://skydrive.live.com/redir?resid=EB5E1E510A150D4D!105 It allows a user to scroll within the container area, contents which you add to the ShapeScrollContainer automatically get moved accordingly. If