【发布时间】:2011-11-07 08:54:07
【问题描述】:
我正在尝试在 iPhone 上展示粒子效果。 该应用程序是通用应用程序。我已经在 iPad 上测试过该应用程序,所以粒子效果在 iPad 上可以正常工作。但它不会出现在 iPhone 上。对 iPhone 屏幕没有影响。
我找不到它不起作用的原因。
@interface MenuSceneController : UIViewController <AVAudioPlayerDelegate>
{
EAGLView *mParticle;
};
- (void)addParticle
{
mParticle = [[EAGLView alloc] initWithFrame:CGRectMake(335, 200, 1024, 768) andFileName:@"particle.pex"];
mParticle.alpha = 0.99;
mParticle.userInteractionEnabled = NO;
[self.view addSubview:mParticle];
[mParticle startAnimation];
}
- (id)initWithFrame:(CGRect)_frame andFileName:(NSString *)_filename
{
if ((self = [super initWithFrame:_frame]))
{
// Get the layer
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
eaglLayer.opaque = NO;
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:FALSE],
kEAGLDrawablePropertyRetainedBacking,
kEAGLColorFormatRGBA8,
kEAGLDrawablePropertyColorFormat,
nil];
renderer = [[ES1Renderer alloc] initWithParticleFileName:_filename];
if (!renderer)
{
[self release];
return nil;
}
animating = FALSE;
displayLinkSupported = TRUE;
animationFrameInterval = 1;
displayLink = nil;
animationTimer = nil;
NSString *reqSysVer = @"3.1";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending)
displayLinkSupported = TRUE;
}
return self;
}
“particle.pex”文件为粒子效果文件。
请帮助我。 谢谢。
【问题讨论】:
标签: iphone ipad cocos2d-iphone