コード例 #1
0
ファイル: CCFrame.cpp プロジェクト: stonejiang208/cocos2d-x
Frame* RotationSkewFrame::clone()
{
    RotationSkewFrame* frame = RotationSkewFrame::create();
    frame->setSkewX(_skewX);
    frame->setSkewY(_skewY);

    frame->cloneProperty(this);

    return frame;
}
コード例 #2
0
ファイル: CCFrame.cpp プロジェクト: stonejiang208/cocos2d-x
// RotationSkewFrame
RotationSkewFrame* RotationSkewFrame::create()
{
    RotationSkewFrame* frame = new (std::nothrow) RotationSkewFrame();
    if (frame)
    {
        frame->autorelease();
        return frame;
    }
    CC_SAFE_DELETE(frame);
    return nullptr;
}
コード例 #3
0
Frame* ActionTimelineCache::loadRotationSkewFrame(const rapidjson::Value& json)
{
    RotationSkewFrame* frame = RotationSkewFrame::create();

    float skewx = DICTOOL->getFloatValue_json(json, X);
    float skewy = DICTOOL->getFloatValue_json(json, Y);

    frame->setSkewX(skewx);
    frame->setSkewY(skewy);

    return frame;
}
コード例 #4
0
Frame* ActionTimelineCache::loadRotationSkewFrameWithFlatBuffers(const flatbuffers::ScaleFrame *flatbuffers)
{
    RotationSkewFrame* frame = RotationSkewFrame::create();
    
    auto f_scale = flatbuffers->scale();
    Vec2 rotationSkew(f_scale->scaleX(), f_scale->scaleY());
    frame->setSkewX(rotationSkew.x);
    frame->setSkewY(rotationSkew.y);
    
    int frameIndex = flatbuffers->frameIndex();
    frame->setFrameIndex(frameIndex);
    
    bool tween = flatbuffers->tween() != 0;
    frame->setTween(tween);
    
    return frame;
}
コード例 #5
0
Frame* ActionTimelineCache::loadRotationSkewFrameWithFlatBuffers(const flatbuffers::TimeLinePointFrame *flatbuffers)
{
    RotationSkewFrame* frame = RotationSkewFrame::create();
    
    auto f_rotationSkew = flatbuffers->postion();
    Vec2 rotationSkew(f_rotationSkew->x(), f_rotationSkew->y());
    frame->setSkewX(rotationSkew.x);
    frame->setSkewY(rotationSkew.y);
    
    int frameIndex = flatbuffers->frameIndex();
    frame->setFrameIndex(frameIndex);
    
    bool tween = flatbuffers->tween();
    frame->setTween(tween);
    
    return frame;
}