我在Nextpeer
中使用Cocos
进行多人游戏,并希望为NextpeerSettingInitialDashboardOrientation
设置纵向方向。我正在使用此代码:
NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:FALSE], NextpeerSettingSupportsDashboardRotation,
[NSNumber numberWithInt:NPNotificationPosition_BOTTOM], NextpeerSettingNotificationPosition,
[NSNumber numberWithBool:FALSE], NextpeerSettingInitialDashboardOrientation,
nil];
[Nextpeer initializeWithProductKey:@"ID" andSettings:settings andDelegates:
[NPDelegatesContainer containerWithNextpeerDelegate:self notificationDelegate:nil tournamentDelegate:self currencyDelegate:nil]];
但我收到警告,我的方向未设为portrait
。它将其设置为Landscape
。我的默认方向为portrait
。
Nextpeer warning: The desired orientation (1) isn't supported by the currently integrated Nextpeer's resource bundle.
如何更改 NextpeerSettingSupportsDashboardRotation ?
如何解决此警告?
答案 0 :(得分:0)
Nextpeer根据您的项目方向和普遍支持提供不同的资源包。
您需要确保集成了对应的资源包。例如,如果您的环境是通用的,那么您需要按照iOS集成指南中的说明在项目中设置NPResources_iPad_iPhone_Landscape
包。
为了将NextpeerSettingSupportsDashboardRotation
值更改为TRUE,只需更改对象值,如下所示:
NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:TRUE], NextpeerSettingSupportsDashboardRotation,
[NSNumber numberWithInt:NPNotificationPosition_BOTTOM], NextpeerSettingNotificationPosition,
[NSNumber numberWithBool:FALSE], NextpeerSettingInitialDashboardOrientation,
nil];