Note that there are some explanatory texts on larger screens.

plurals
  1. POImage not correctly positioned in the screen in andengine
    primarykey
    data
    text
    <p>Am new to andengine. Am trying to implement the game controller image in the screen. Am following the andengine examples. But the image is broken and appeared in the corner of the screen in a shape of triangle. Please Help. My code as follows.....................</p> <pre><code>public class ExtremeGame extends SimpleBaseGameActivity { private static final int CAMERA_WIDTH = 800; private static final int CAMERA_HEIGHT = 480; private Camera mCamera; private BitmapTextureAtlas mBitmapTextureAtlas; private TextureRegion mFaceTextureRegion; private BitmapTextureAtlas mOnScreenControlTexture; private TextureRegion mOnScreenControlBaseTextureRegion; private TextureRegion mOnScreenControlKnobTextureRegion; private DigitalOnScreenControl mDigitalOnScreenControl; @Override public EngineOptions onCreateEngineOptions() { this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); return new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera); } @Override protected void onCreateResources() { BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/"); this.mBitmapTextureAtlas = new BitmapTextureAtlas(null, 32, 32, TextureOptions.BILINEAR_PREMULTIPLYALPHA); this.mFaceTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mBitmapTextureAtlas, this, "face_box.png", 0, 0); this.mOnScreenControlTexture = new BitmapTextureAtlas(null, 256, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA); this.mOnScreenControlBaseTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, this, "onscreen_control_base.png", 0, 0); this.mOnScreenControlKnobTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, this, "onscreen_control_knob.png", 128, 0); this.mEngine.getTextureManager().loadTexture(mOnScreenControlTexture); } @Override protected Scene onCreateScene() { this.mEngine.registerUpdateHandler(new FPSLogger()); final Scene scene = new Scene(); final int centerX = (int) ((CAMERA_WIDTH - this.mFaceTextureRegion.getWidth()) / 2); final int centerY = (int) ((CAMERA_HEIGHT - this.mFaceTextureRegion.getHeight()) / 2); final Sprite face = new Sprite(centerX, centerY, mFaceTextureRegion, getVertexBufferObjectManager()); final PhysicsHandler physicsHandler = new PhysicsHandler(face); face.registerUpdateHandler(physicsHandler); scene.attachChild(face); this.mDigitalOnScreenControl.getControlBase().setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); this.mDigitalOnScreenControl.getControlBase().setAlpha(0.5f); this.mDigitalOnScreenControl.getControlBase().setScaleCenter(0, 128); this.mDigitalOnScreenControl.getControlBase().setScale(1.25f); this.mDigitalOnScreenControl.getControlKnob().setScale(1.25f); this.mDigitalOnScreenControl.refreshControlKnobPosition(); scene.setChildScene(this.mDigitalOnScreenControl); return scene; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload