微件:Chibi:修订间差异
跳转到导航
跳转到搜索
小 (文本替换 - 替换“zjsnrwiki.oss-cn-hangzhou.aliyuncs.com”为“0v0.zjsnrwiki.com”) 标签:手工回退 |
无编辑摘要 |
||
第1行: | 第1行: | ||
<includeonly> | <includeonly> | ||
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/pixi.js/5.3.3/pixi.js"></script> | <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/pixi.js/5.3.3/pixi.js"></script> | ||
<script src="https://0v0.zjsnrwiki.com/gameRes/chibi/pixiv5-spine3. | <script src="https://0v0.zjsnrwiki.com/gameRes/chibi/pixiv5-spine3.8.js"></script> | ||
<script> | <script> | ||
function chibiAnimation(index, loadButton) { | function chibiAnimation(index, loadButton) { | ||
loadButton.style.display = "none"; | loadButton.style.display = "none"; | ||
const pngFile = 'https://0v0.zjsnrwiki.com/gameRes/chibi/spine/' + index + '/Ship_girl_' + index + '.png'; | |||
const atlasFile = 'https://0v0.zjsnrwiki.com/gameRes/chibi/spine/' + index + '/Ship_girl_' + index + '.atlas'; | |||
var jsonFile = index + '/Ship_girl_' + index + '.38.skel'; | |||
//特殊修复(记得atlas文件去空格)。转码工具:https://naganeko.pages.dev/chibi-gif/ | |||
if (indexList[index] == '1050' || indexList[index] == '1057') | |||
jsonFile = index + '/Ship_girl_' + index + '.38.json'; | |||
//分别加载png,atlas文件 | |||
var spineLoaderOptions = { | |||
metadata: { | |||
image: PIXI.BaseTexture.fromImage(pngFile), | |||
spineAtlasFile: atlasFile | |||
} | |||
}; | |||
//调整半透明渲染模式 | |||
spineLoaderOptions.metadata.image.alphaMode = PIXI.ALPHA_MODES.PMA | |||
//加载播放器 | //加载播放器 | ||
第20行: | 第35行: | ||
app.stop(); | app.stop(); | ||
loader = new PIXI.Loader('https://0v0.zjsnrwiki.com/gameRes/chibi/spine/'); | |||
loader = new PIXI.Loader('https://0v0.zjsnrwiki.com/gameRes/chibi/ | |||
loader | loader | ||
.add('spineCharacter', | .add('spineCharacter', jsonFile, spineLoaderOptions) | ||
.load(onAssetsLoaded); | .load(onAssetsLoaded); | ||
第37行: | 第44行: | ||
function onAssetsLoaded(loader, res) { | function onAssetsLoaded(loader, res) { | ||
//载入骨架 | //载入骨架 | ||
第156行: | 第161行: | ||
case 5: | case 5: | ||
chibi.state.setAnimation(0, 'wreck', true, 0); | chibi.state.setAnimation(0, 'wreck', true, 0); | ||
break; | |||
case 6: | |||
chibi.state.setAnimation(0, 'w', true, 0); | |||
break; | |||
case 7: | |||
chibi.state.setAnimation(0, 's', true, 0); | |||
break; | break; | ||
} | } | ||
第176行: | 第187行: | ||
rectangle.alpha == 0 ? rectangle.alpha = 1 : rectangle.alpha = 0; | rectangle.alpha == 0 ? rectangle.alpha = 1 : rectangle.alpha = 0; | ||
} | } | ||
} | } | ||
</includeonly> | </includeonly> |