// // PlainNode.h // SteveMaggieCpp // // Created by Katarzyna Kalinowska-Górska on 17.05.2017. // // #ifndef PlainNode_h #define PlainNode_h #include "cocos2d.h" #include "LayoutObject.h" #include "LayoutParser.h" class PlainNode : public cocos2d::Node, public LayoutObject { public: static PlainNode* create(); static PlainNode* createWithColour(cocos2d::Color4B color); // virtual bool init() override; virtual void loadPropertiesFromJSON(const rapidjson::Value& jsonValue, LayoutViewInterface* scene = NULL, const std::string resFolder = "", const std::string altResFolder = "") override; virtual void prepareSize(const rapidjson::Value& jsonValue, float& width, float& height) override; virtual void setContentSize(const cocos2d::Size& contentSize) override { cocos2d::Node::setContentSize(contentSize); if(_backgroundLayer != nullptr){ _backgroundLayer->setContentSize(contentSize); _backgroundLayer->setPosition(cocos2d::Vec2(contentSize.width/2, contentSize.height/2)); } } protected: cocos2d::LayerColor* _backgroundLayer; }; #endif /* PlainNode_h */