我开发了一个starling游戏,在修复多分辨率问题后,我陷入了另一个
当我尝试在底部实现Revmob横幅广告时,它会在三星音符的屏幕中间显示 - 但在三星Galaxy S2上,它显示在底部是完美的。 我不知道如何解决这个问题 这是我尝试实施revmob横幅广告的两种方式
Game.revmob.showBanner(0,stage.stageHeight);
OR
Game.revmob.showBanner(); 这是多分辨率的代码
public class FTC extends MovieClip
{
public static var star:Starling;
public static var debugSprite:flash.display.Sprite;
public static var _baseWidth:Number = 480;
private static const STAGE_WIDTH:int = 320;
private static const STAGE_HEIGHT:int = 480;
public static var DIMX:Number;
public static var DIMY:Number;
/**
* The height that the app is based on, this should be the lowest height such as 480 (iphone) or 512 (ipad)
*/
public static var _baseHeight:Number = 800;
public function FTC()
{
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
Starling.handleLostContext = true;
// Get the preferred stage size based on our smallest target resolution
var stageArea:Rectangle = new Rectangle(0, 0, STAGE_WIDTH, STAGE_HEIGHT);
// Get the fullscreen size available
var fullscreenArea:Rectangle = new Rectangle(0, 0, stage.fullScreenWidth, stage.fullScreenHeight);
// Fit the stage to the full screen. ScaleMode.SHOW_ALL ensures that everything will be visible (not croping will occur).
var viewport:Rectangle = RectangleUtil.fit(stageArea, fullscreenArea, ScaleMode.SHOW_ALL);
// Create a new instance and pass our class, the stage and the wished viewport
star= new Starling(Game, stage, viewport);
// Show debug stats
// star.showStats = true;
// Define level of antialiasing,
star.antiAliasing = 1;
// Set to our preferred stage size
star.stage.stageWidth = STAGE_WIDTH;
star.stage.stageHeight = STAGE_HEIGHT;
star.start();
}
private function onResized(e:Event):void
{
var viewPort:Rectangle = star.viewPort;
viewPort.width = this.stage.stageWidth;
viewPort.height = this.stage.stageHeight;
star.viewPort = viewPort;
star.stage.stageWidth = stage.stageWidth;
star.stage.stageHeight = stage.stageHeight;
}
}
答案 0 :(得分:0)
尝试检查是否已调用“onResized”方法,或者您可以在onResized(null);
来电后放置star.start();
来强制拨打电话。