├── dev ├── 1.gif ├── 1.png └── index.html ├── src ├── 1.gif ├── 1.png ├── css │ └── _fws │ │ └── _imagesData.scss ├── lib │ ├── _getExeName.es6 │ ├── _omggif.es6 │ └── _upng.es6 ├── demo.es6 ├── index.html └── PixiApngAndGif.es6 ├── dist ├── 1.gif ├── 1.png ├── index.html └── PixiApngAndGif.js ├── .gitignore ├── yarn.lock ├── package.json ├── fws_config.js └── README.md /dev/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbfkcel/pixi-apngAndGif/HEAD/dev/1.gif -------------------------------------------------------------------------------- /dev/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbfkcel/pixi-apngAndGif/HEAD/dev/1.png -------------------------------------------------------------------------------- /src/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbfkcel/pixi-apngAndGif/HEAD/src/1.gif -------------------------------------------------------------------------------- /src/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbfkcel/pixi-apngAndGif/HEAD/src/1.png -------------------------------------------------------------------------------- /dist/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbfkcel/pixi-apngAndGif/HEAD/dist/1.gif -------------------------------------------------------------------------------- /dist/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbfkcel/pixi-apngAndGif/HEAD/dist/1.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /.vscode/ 3 | .DS_Store 4 | .psd 5 | *.DS_Store 6 | *.psd 7 | project.config.json 8 | -------------------------------------------------------------------------------- /src/css/_fws/_imagesData.scss: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | //Updated by FWS. Tue Mar 10 2020 09:17:25 GMT+0800 (GMT+08:00) 3 | $_imagesData:() -------------------------------------------------------------------------------- /src/lib/_getExeName.es6: -------------------------------------------------------------------------------- 1 | export default (filePath)=>{ 2 | let aList = filePath.split('.'); 3 | return aList[aList.length - 1]; 4 | }; -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | pako@^1.0.6: 6 | version "1.0.11" 7 | resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" 8 | integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pixi-apngandgif", 3 | "version": "1.0.2", 4 | "description": "Let pixi.js support apng, gif images", 5 | "main": "./dist/PixiApngAndGif.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/sbfkcel/pixi-apngAndGif.git" 12 | }, 13 | "keywords": [ 14 | "pixi", 15 | "apng", 16 | "png", 17 | "gif", 18 | "canvas" 19 | ], 20 | "author": "sbfkcel@163.com", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/sbfkcel/pixi-apngAndGif/issues" 24 | }, 25 | "homepage": "https://github.com/sbfkcel/pixi-apngAndGif#readme", 26 | "dependencies": { 27 | "pako": "^1.0.6" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fws_config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "author": "FWS", 3 | "mail": "china1099@qq.com", 4 | "projectName": "pixi-apngAndGi", 5 | "template": "default", 6 | "createTime": 1538119743322, 7 | "distReplace": { 8 | "*": [ 9 | { 10 | "find": "feutil.localstatic.com", 11 | "replace": "pic.my4399.com/re/cms/feUtil" 12 | }, 13 | { 14 | "find": "$$localhost/staticfile", 15 | "replace": "pic.my4399.com/re/cms/feUtil" 16 | } 17 | ] 18 | }, 19 | "srcSync": { 20 | "targetPath": "", 21 | "fileType": "*" 22 | }, 23 | "devSync": { 24 | "targetPath": "", 25 | "fileType": "*" 26 | }, 27 | "distSync": { 28 | "targetPath": "", 29 | "fileType": "*" 30 | } 31 | }; -------------------------------------------------------------------------------- /src/demo.es6: -------------------------------------------------------------------------------- 1 | import $apngAndGif from './PixiApngAndGif' 2 | 3 | const app = new PIXI.Application(); 4 | 5 | const loader = PIXI.Loader.shared, 6 | title = document.title, 7 | loadOption = { 8 | loadType: PIXI.LoaderResource.LOAD_TYPE.XHR, 9 | xhrType: PIXI.LoaderResource.XHR_RESPONSE_TYPE.BUFFER, 10 | crossOrigin:'' 11 | }, 12 | imgs = { 13 | gif:'http://isparta.github.io/compare/image/dongtai/gif/1.gif', 14 | apng:'http://isparta.github.io/compare/image/dongtai/apng/1.png' 15 | // gif:'./1.gif', 16 | // apng:'./1.png' 17 | }; 18 | 19 | 20 | loader.add(imgs.gif,loadOption); 21 | loader.add(imgs.apng,loadOption); 22 | 23 | loader.on('progress',(loader,resoure)=>{ 24 | document.title = Math.round(loader.progress); 25 | }).load((progress,resources)=>{ 26 | document.title = title; 27 | 28 | window.gif = new $apngAndGif(imgs.gif,resources); 29 | window.apng = new $apngAndGif(imgs.apng,resources); 30 | 31 | let gifSprite = window.gif.sprite, 32 | apngSprite = window.apng.sprite; 33 | 34 | gifSprite.x = 100; 35 | apngSprite.x = 450; 36 | 37 | gifSprite.y = 160; 38 | apngSprite.y = 160; 39 | 40 | app.stage.addChild(gifSprite); 41 | app.stage.addChild(apngSprite); 42 | }); 43 | 44 | document.body.appendChild(app.view); -------------------------------------------------------------------------------- /dev/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |