HPlainNode.cpp
845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
//  HPlainNode.cpp
//  SteveMaggieCpp
//
//  Created by Katarzyna Kalinowska-Górska on 17.05.2017.
//
//
#include <stdio.h>
#include "HPlainNode.h"
HPlainNode* HPlainNode::create()
{
    HPlainNode * node = new (std::nothrow) HPlainNode();
    if(node && node->init())
    {
        node->autorelease();
        return node;
    }
    CC_SAFE_DELETE(node);
    return nullptr;
}
void HPlainNode::loadPropertiesFromJSON(const rapidjson::Value& jsonValue, HLayoutViewInterface* scene, const std::string resFolder, const std::string altResFolder)
{
    this->setAnchorPoint(cocos2d::Point(0.5, 0.5));
    this->loadCommonPropertiesFromJSON(jsonValue);
}
void HPlainNode::prepareSize(const rapidjson::Value& jsonValue, float& width, float& height)
{
    width = this->getContentSize().width;
    height = this->getContentSize().height;
}