Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public EngineOptions onCreateEngineOptions() {
- this.display = getWindowManager().getDefaultDisplay();//get screen from system
- this.screenwidth = display.getWidth();
- this.screenheight = display.getHeight();
- float screenratio;
- int screenscale = 300; /* sets height, width is derived from following equation*/
- if(screenwidth>screenheight)
- {
- screenratio=screenwidth/screenheight;
- height = screenscale;
- width = (int)(screenscale*screenratio);
- }
- else
- {
- screenratio=screenheight/screenwidth;
- width = screenscale;
- height = (int) (screenscale*screenratio);
- }
- screenwidth = width;
- screenheight = height;
- this.mCamera = new SmoothCamera(0, 0, width, height, 1000, 1000, 10);//create smooth scrolling camera
- this.engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(screenratio), mCamera);
- return engineOptions;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement