-(
void
)awakeFromNib
{
CAEmitterLayer* fireEmitter = (CAEmitterLayer*)
self
.layer; ;
fireEmitter.emitterPosition =
CGPointMake
(
.bounds.size.width/
2
,
.bounds.size.height);
fireEmitter.emitterMode = kCAEmitterLayerOutline;
fireEmitter.emitterShape = kCAEmitterLayerLine;
fireEmitter.emitterSize =
CGSizeMake
5
);
float
gas=
.7
;
// Create the fire emitter cell
CAEmitterCell *fire = [CAEmitterCell emitterCell];
fire.emissionLongitude =
M_PI
;
fire.emissionLatitude = -
/
;
fire.BirthRate =
0
;
//100*gas;
fire.lifetime=gas;
fire.lifetimeRange=gas*
0
.35
;
fire.EmissionRange =
1
.1
f;
fire.ScaleSpeed =
.3
f;
fire.color=[[
UIColor
colorWithRed:
.8
green:
.4
blue:
.2
alpha:
]
CGColor
];
fire.contents = (
id
)[[
UIImage
imageNamed:
@"fire.png"
CGImage
];
[fire setName:
@"fire"
];
CAEmitterCell *smoke = [CAEmitterCell emitterCell];
smoke.BirthRate =
//11;
smoke.emissionLongitude = -
;
smoke.emissionLatitude=-
;
smoke.lifetime = gas*
4
;
smoke.emissionRange =
/
;
smoke.Spin =
1
;
smoke.SpinRange =
6
;
smoke.Scale =
f;
smoke.AlphaSpeed = -
.22
f;
smoke.ScaleSpeed =
f;
smoke.color=[[
*gas]
];
smoke.contents = (
@"smoke.png"
];
[smoke setName:
@"smoke"
];
fireEmitter.emitterCells = [
NSArray
arrayWithObjects:smoke,fire,157)!important">nil
];
}
You can download Hanukkah Menorah on the app store Now for FREE. It supports both the iPad and iPhone. It also has some in-app-Purchases to change from the default menorah.
|