0

我在starling中开发了一款游戏,在解决了多分辨率问题后,我陷入了另一个问题

当我尝试在底部实施 Revmob 横幅广告时,它显示在 samsung note 的屏幕中间 - 但在 samsung Galaxy S2 上,它显示在底部,这是完美的。我不知道如何解决这个问题,这是我尝试实施 revmob 横幅广告的两种方法

Game.revmob.showBanner(0 , stage.stageHeight);

或者

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;

    }

}
4

1 回答 1

0

尝试检查是否已调用“onResized”方法,或者您可以通过onResized(null);在调用后放置 a 来强制调用它star.start();

于 2014-02-24T14:15:20.883 回答