最近我开始研究AndEngine.在这方面很难找到最新的文件/帮助材料.我正在尝试通过示例和源代码后设置背景图像.但由于某种原因,屏幕仍然是空白的.我无法找到与此相关的任何有用信息.这是代码:
public class AndEngineActivity extends BaseGameActivity {
private static final int CAMERA_WIDTH = 720;
private static final int CAMERA_HEIGHT = 480;
private Camera mCamera;
private TextureRegion mBgTexture;
private BitmapTextureAtlas mBackgroundTexture;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public Engine onLoadEngine() {
// TODO Auto-generated method stub
this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));
}
@Override
public void onLoadResources() { …
Run Code Online (Sandbox Code Playgroud) 我是 Android 新手,找不到任何合适的方法来使画布可滚动。我进行了很多搜索,但没有人对实际要做的事情给出完整的概述。只是模糊的想法和不完整的代码示例。任何帮助,将不胜感激。我已经扩展了滚动视图,并在画布上绘制了一个大于屏幕尺寸的 png 图像。滚动条确实出现,但随后消失并且没有滚动。我缺少什么?