8000 Gif/engine support by knoxHuang · Pull Request #9636 · cocos/cocos-engine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Gif/engine support #9636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions cocos2d/core/assets/CCGifAssset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/****************************************************************************
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.

https://www.cocos.com/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated engine source code (the "Software"), a limited,
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
to use Cocos Creator solely to develop games on your target platforms. You shall
not use Cocos Creator software for developing other software or tools that's
used for developing games. You are not granted to publish, distribute,
sublicense, and/or sell copies of Cocos Creator.

The software or tools in this License Agreement are licensed, not sold.
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/

const Asset = require('./CCAsset');

const GifAsset = cc.Class({
name: 'cc.GifAsset',
extends: Asset,

properties: {
/**
* !#en Gif prefab is used to create node
* !#zh gif 节点预制
* @property prefab
* @type {Prefab}
* @default null
*/
prefab: {
get: function () {
return this._prefab;
},
set: function (value) {
this._prefab = value;
}
},
/**
* !#en Gif sequence SpriteFrame
* !#zh gif 序列 SpriteFrame
* @property spriteFrames
* @type {Object}
* @default {}
*/
spriteFrames: {
get: function () {
return this._spriteFrames;
},
set: function (value) {
this._spriteFrames = value;
}
},
/**
* !#en Gif AnimationClip
* !#zh gif 动画剪辑
* @property animationClip
* @type {AnimationClip}
* @default null
*/
animationClip: {
get: function () {
return this._animationClip;
},
set: function (value) {
this._animationClip = value;
}
}
},

ctor: function () {
this._prefab = null;
this._animationClip = null;
this._spriteFrames = {};
},

});
cc.GifAsset = GifAsset;
module.exports = GifAsset;
1 change: 1 addition & 0 deletions cocos2d/core/assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ require('./CCTextAsset');
require('./CCJsonAsset');
require('./CCBufferAsset');
require('./material');
require('./CCGifAssset');
0