I am developing (learning to build :) games on andengine GLES2 . I am using basic gaming activity and the setContent view to place my ad.
Everything works fine except for permission policy.
A relationship resolution policy is one that I use with CAMERA_WIDTH = 800; and CAMERA_HEIGHT = 480; CAMERA_WIDTH = 800; and CAMERA_HEIGHT = 480; CAMERA_WIDTH = 800; and CAMERA_HEIGHT = 480;
The problem is that when overriding, the onsetContentView scene onsetContentView not centered, and the fields are displayed only at the bottom, not at the top and bottom. The same thing happens if you align it horizontally: the field will be displayed only on the right, and not on both sides. How can i fix this? I give my code below:
@Override protected void onSetContentView() { System.out.println("Content setting"); this.mRenderSurfaceView = new RenderSurfaceView(this); final LayoutParams layoutParams = new LayoutParams( android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT); layoutParams.gravity = Gravity.LEFT ; final android.widget.FrameLayout.LayoutParams surfaceViewLayoutParams = new FrameLayout.LayoutParams( layoutParams); adView = new AdView(this, AdSize.BANNER, "xxxxxxxxxxxxx"); final FrameLayout.LayoutParams adViewLayoutParams = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.LEFT ); final FrameLayout frameLayout = new FrameLayout(this); final FrameLayout.LayoutParams frameLayoutLayoutParams = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.FILL_PARENT,Gravity.CENTER); frameLayout.addView(this.mRenderSurfaceView, surfaceViewLayoutParams); frameLayout.addView(adView, adViewLayoutParams); this.setContentView(frameLayout, frameLayoutLayoutParams); this.mRenderSurfaceView.setRenderer(this.mEngine, this); }
here is the image i get, you can see the white field under the scene if you select the image (it does not get attention, since the stack overflow also has a white background)

any suggestions would be very helpful to me
How can I solve this problem, please help me
Thanks everyone
Renjith kn
source share