Cocos2d-x V3。如何确定不同屏幕尺寸的admob横幅高度?

时间:2016-07-29 18:28:44

标签: cocos2d-iphone admob cocos2d-x cocos2d-x-3.0

矩形位于y = 102。

auto spr    = Sprite::create("images/interface/wideBtnBlack.png");
Vec2 origin = Director::getInstance()->getVisibleOrigin();
spr->setColor(Color3B::GREEN);
spr->setPosition(Vec2(origin.x + 200, origin.y + 102));
spr->setAnchorPoint(Vec2::ZERO);

如何确保矩形位于所有设备横幅的正上方?

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:-1)

您可以根据设备设置横幅尺寸。然后通过做简单的数学你可以实现你想要获得的东西。或使用Admob委托方法获取横幅高度。

Banner.Height + (Object.Height/2) = Position Exactly Above Banner.