谁能告诉我如何配置图表助推添加平台和引擎游戏,以显示添加在游戏中。我已经下载了chartboost sdk,并且我试图在ChartBoost中配置onCreateEngineOption,例如-
public EngineOptions onCreateEngineOptions()
{
camera = new BoundCamera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), this.camera);
engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);//turn on the music and sound option
engineOptions.getRenderOptions().getConfigChooserOptions().setRequestedMultiSampling(true);
engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);//tell the engine to always keep the screen unloced while game is running
engineOptions.getRenderOptions().setDithering(true);//enable the Dithering for the whole game by default
return engineOptions;
// Configure Chartboost
this.cb = Chartboost.sharedChartboost();
String appId = "YOUR_APP_ID";
String appSignature = "YOUR_APP_SIGNATURE";
this.cb.onCreate(this, appId, appSignature, null);
}我的游戏要崩溃了..。谢谢!
发布于 2014-04-01 07:01:40
我自己想出了如何将Chartboost集成到一个Andengine游戏中
步骤1)在OnCreateEngineOption中初始化Chartboost
//ChrtBoost Code
cb = Chartboost.sharedChartboost();
String appId = "****************";
String appSignature = "****************************";
cb.onCreate(this,appId,appSignature, null);
cb.onStart(this);
cb.setImpressionsUseActivities(true);
//end of chartBoost Code步骤2)开始会话在onCreateResource方法中
this.runOnUiThread(new Runnable() {
public void run() {
cb.startSession();
cb.showInterstitial();
}
});步骤3缓存添加的初始使用onCreateScene方法
//cache the adds initially
this.cb.cacheInterstitial();步骤4显示在场景调用中添加以下方法
cb.showInterstitial();发布于 2013-12-13 20:18:56
Chartboost希望将其添加到标准android活动中的视图中,而不是作为a引擎的一部分。您应该使用SimpleLayoutGameActivity作为您的游戏活动,以便为您的广告服务提供XML布局。
看看XMLLayoutExample (https://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/XMLLayoutExample.java)
或者看看我不久前使用和andengine GLES1所做的这个旧的实现。需求也将是相似的。这使用AdMob而不是Chartboost,但是您的应用程序崩溃的原因是一样的:您需要使用自定义的XMLlayout来使您的广告服务工作。
https://github.com/zfoley/AndengineAdmobLayoutExample
希望这能让你走上正轨!
https://stackoverflow.com/questions/20561060
复制相似问题