CCLightning
CCLightning
Cocos2DInheritance: System.Object → Cocos2D.CCNode → Cocos2D.CCDrawNode
Implements: Cocos2D.ICCSelectorProtocol, Cocos2D.ICCFocusable, Cocos2D.ICCTargetedTouchDelegate, Cocos2D.ICCStandardTouchDelegate, Cocos2D.ICCTouchDelegate, Cocos2D.ICCKeypadDelegate, Cocos2D.ICCKeyboardDelegate, Cocos2D.ICCRGBAProtocol, System.Collections.Generic.IComparer{Cocos2D.CCNode}
Constructors
CCLightning()
CCLightning()()
Fields
LightningBlue(Cocos2D.CCColor4F)
Typical blue for lightning.
LightningBlueGlow(Cocos2D.CCColor4F)
Properties
DrawShadowSegments(System.Boolean)
GlowSize(System.Single)
Sway(System.Single)
Methods
AddBolt(CCLightningBolt)
AddBolt(CCLightningBolt)(Cocos2D.CCLightningBolt bolt)
Parameters:
bolt
(Cocos2D.CCLightningBolt)Clear()
Clear()()
Removes the drawn vertices and clears out the lightning. New lightning will be drawn upon the next update.
Example
CreateBolt(CCPoint, CCPoint)
System.Collections.Generic.ListCocos2D.CCPoint CreateBolt(CCPoint, CCPoint)(Cocos2D.CCPoint source, Cocos2D.CCPoint dest)
Creates the full set of bolt segments between the start and end points. Based upon the algorithm found at http://gamedevelopment.tutsplus.com/tutorials/how-to-generate-shockingly-good-2d-lightning-effects--gamedev-2681 by Michael Hoffman.
Parameters:
source
(Cocos2D.CCPoint)dest
(Cocos2D.CCPoint)Returns:
System.Collections.Generic.ListCocos2D.CCPoint
Example
OnEnter()
OnEnter()()
Example
Update(float)
Update(float)(System.Single dt)
Parameters:
dt
(System.Single)Example