ToyPlainLabel.h 1.18 KB
//
//  ToyPlainLabel.h
//  WattsenglishToyApp
//
//  Created by Katarzyna Kalinowska-Górska on 19/11/2019.
//

#ifndef ToyPlainLabel_h
#define ToyPlainLabel_h

#include "cocos2d.h"
#include "ToyLayoutObject.h"

class ToyPlainLabel : public cocos2d::Label, public ToyLayoutObject
{
    public:
    
        static ToyPlainLabel* create(const std::string& text, const std::string fontPath, int fontBaseSize);
    
    virtual bool init(const std::string& text, const std::string fontPath, int fontBaseSize);
    
        virtual void loadPropertiesFromJSON(const rapidjson::Value& jsonValue, ToyLayoutViewInterface* scene = NULL, const std::string resFolder = "", const std::string altResFolder = "") override;
        virtual void prepareSize(const rapidjson::Value& jsonValue, float& width, float& height) override;

        // ToyScenarioObject
    
        virtual void setProperty(std::string propertyName, const rapidjson::Value& newValue, ActionParseDelegate* parseDelegate) override;
        virtual void callFunctionByName(std::string methodName, const rapidjson::Value* arguments, ActionParseDelegate* parseDelegate, std::function<void()> callback = [](){}) override;
};

#endif /* ToyPlainLabel_h */