Exemplo n.º 1
0
Frame* AnchorPointFrame::clone()
{
    AnchorPointFrame* frame = AnchorPointFrame::create();
    frame->setAnchorPoint(_anchorPoint);

    frame->cloneProperty(this);

    return frame;
}
Exemplo n.º 2
0
// AnchorPointFrame
AnchorPointFrame* AnchorPointFrame::create()
{
    AnchorPointFrame* frame = new (std::nothrow) AnchorPointFrame();
    if (frame)
    {
        frame->autorelease();
        return frame;
    }
    CC_SAFE_DELETE(frame);
    return nullptr;
}
Frame* ActionTimelineCache::loadAnchorPointFrame (const rapidjson::Value& json)
{
    AnchorPointFrame* frame = AnchorPointFrame::create();

    float anchorx = DICTOOL->getFloatValue_json(json, X);
    float anchory = DICTOOL->getFloatValue_json(json, Y);

    frame->setAnchorPoint(Point(anchorx, anchory));

    return frame;
}
 Frame* ActionTimelineCache::loadAnchorPointFrameWithFlatBuffers(const flatbuffers::ScaleFrame *flatbuffers)
 {
     AnchorPointFrame* frame = AnchorPointFrame::create();
     
     auto f_scale = flatbuffers->scale();
     Vec2 scale(f_scale->scaleX(), f_scale->scaleY());
     frame->setAnchorPoint(scale);
     
     int frameIndex = flatbuffers->frameIndex();
     frame->setFrameIndex(frameIndex);
     
     bool tween = flatbuffers->tween() != 0;
     frame->setTween(tween);
     
     return frame;
 }
Frame* ActionTimelineCache::loadAnchorPointFrameWithFlatBuffers(const flatbuffers::TimeLinePointFrame *flatbuffers)
{
    AnchorPointFrame* frame = AnchorPointFrame::create();
    
    auto f_anchorPoint = flatbuffers->postion();
    Vec2 anchorPoint(f_anchorPoint->x(), f_anchorPoint->y());
    frame->setAnchorPoint(anchorPoint);
    
    int frameIndex = flatbuffers->frameIndex();
    frame->setFrameIndex(frameIndex);
    
    bool tween = flatbuffers->tween();
    frame->setTween(tween);
    
    return frame;
}