Compare commits

...

8 commits

Author SHA1 Message Date
HJfod
ff8de4eec6
Merge pull request #1036 from Prevter/lightning
cocos2d::CCLightning
2024-08-13 21:26:25 +03:00
Oleksandr Nemesh
3ea6001ca4
fix members 2024-08-10 18:58:32 +03:00
Oleksandr Nemesh
bcff1652b8
Merge branch 'geode-sdk:main' into lightning 2024-08-10 13:37:18 +03:00
Oleksandr Nemesh
fca774adbf
cleanup the header 2024-08-10 13:37:08 +03:00
Oleksandr Nemesh
94dc60a7f2
fix whitespace 2024-07-24 12:34:55 +03:00
Oleksandr Nemesh
e46353908d
fix ccColor 2024-07-11 14:50:09 +03:00
Oleksandr Nemesh
0ee2b5beb2
add include 2024-07-11 14:46:55 +03:00
Oleksandr Nemesh
360827e766
add cclightning 2024-07-11 14:45:03 +03:00
2 changed files with 72 additions and 0 deletions

View file

@ -325,6 +325,8 @@ THE SOFTWARE.
#include "../robtop/scene_nodes/CCSceneTransitionDelegate.h"
#include "../robtop/special_nodes/CCLightning.h"
#include "../robtop/xml/DS_Dictionary.h"
#include "../robtop/xml/ObjectDecoder.h"

View file

@ -0,0 +1,70 @@
#ifndef __CCLIGHTNING_H__
#define __CCLIGHTNING_H__
#include "../../include/ccMacros.h"
#include "../../base_nodes/CCNode.h"
NS_CC_BEGIN
// @note RobTop Addition
class CCLightning : public CCNode, public CCRGBAProtocol {
public:
CCLightning();
virtual ~CCLightning();
static CCLightning* lightningWithStrikePoint(CCPoint strikePoint, CCPoint strikePoint2, float duration);
static CCLightning* lightningWithStrikePoint(CCPoint strikePoint);
bool initWithStrikePoint(CCPoint strikePoint, CCPoint strikePoint2, float duration);
bool initWithStrikePoint(CCPoint strikePoint);
void strike();
void strikeFinished();
void strikeRandom();
void strikeWithSeed(uint64_t seed);
void draw();
// cocos2d::CCRGBAProtocol
bool isOpacityModifyRGB();
void setOpacityModifyRGB(bool);
unsigned char getOpacity();
unsigned char getDisplayedOpacity();
void setOpacity(unsigned char);
void updateDisplayedOpacity(unsigned char);
bool isCascadeColorEnabled();
void setCascadeOpacityEnabled(bool);
ccColor3B const& getColor();
ccColor3B const& getDisplayedColor();
void setColor(ccColor3B const&);
void updateDisplayedColor(ccColor3B const&);
bool isCascadeOpacityEnabled();
void setCascadeColorEnabled(bool);
protected:
CCPoint m_strikePoint;
CCPoint m_strikePoint2;
bool m_split;
int m_displacement;
int m_minDisplacement;
uint64_t m_seed;
float m_lineWidth;
bool m_unkBool;
bool m_removeAfterFinished;
float m_duration;
float m_opacityModify;
std::array<CCPoint, 200>* m_lightningPoints;
uint32_t m_numPoints;
uint8_t m_displayedOpacity;
uint8_t m_opacity;
ccColor3B m_displayedColor;
ccColor3B m_color;
bool m_cascadeColorEnabled;
bool m_cascadeOpacityEnabled;
bool m_opacityModifyEnabled;
};
NS_CC_END
#endif //__CCLIGHTNING_H__