AlertView.h
1.06 KB
//
// AlertView.h
// HalloweenSpaceInvaders
//
// Created by Katarzyna Kalinowska-Górska on 09/10/2019.
//
#ifndef AlertView_h
#define AlertView_h
#include "cocos2d.h"
#include <string>
class AlertView : public cocos2d::LayerColor {
public:
static AlertView* create(std::string message, std::string okText, std::string cancelText, cocos2d::Color3B okColor, cocos2d::Color3B cancelColor, std::function<void()> onConfirmCallback,std::function<void()> onCancelCallback);
protected:
std::function<void()> _onConfirmCallback;
std::function<void()> _onCancelCallback;
bool init(std::string message, std::string okText, std::string cancelText, cocos2d::Color3B okColor, cocos2d::Color3B cancelColor, std::function<void()> onConfirmCallback,std::function<void()> onCancelCallback);
void setupAppearance(std::string message, std::string okText, std::string cancelText, cocos2d::Color3B okColor, cocos2d::Color3B cancelColor);
void onCancelClicked(cocos2d::Ref* pSender);
void onOKClicked(cocos2d::Ref* pSender);
};
#endif /* AlertView_h */