微件:Chibi:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
(未显示同一用户的10个中间版本) | |||
第1行: | 第1行: | ||
<includeonly> | <includeonly> | ||
<script src="https:// | <script src="https://0v0.zjsnrwiki.com/gameRes/chibi/pixi.js"></script> | ||
<script src="https://0v0.zjsnrwiki.com/gameRes/chibi/pixiv5-spine3.8.js"></script> | <script src="https://0v0.zjsnrwiki.com/gameRes/chibi/pixiv5-spine3.8.js"></script> | ||
<script> | <script> | ||
第11行: | 第11行: | ||
var jsonFile = index + '/Ship_girl_' + index + '.38.skel'; | var jsonFile = index + '/Ship_girl_' + index + '.38.skel'; | ||
//特殊修复(记得atlas文件去空格)。转码工具:https://naganeko.pages.dev/chibi-gif/ | //特殊修复(记得atlas文件去空格)。转码工具:https://naganeko.pages.dev/chibi-gif/ | ||
if (index == '1050' || index == '1057') | if (index == '1050' || index == '1057' || index == '256' || index == '408_2') | ||
jsonFile = index + '/Ship_girl_' + index + '.38.json'; | jsonFile = index + '/Ship_girl_' + index + '.38.json'; | ||
第17行: | 第17行: | ||
var spineLoaderOptions = { | var spineLoaderOptions = { | ||
metadata: { | metadata: { | ||
image: PIXI.BaseTexture. | image: PIXI.BaseTexture.from(pngFile), | ||
spineAtlasFile: atlasFile | spineAtlasFile: atlasFile | ||
} | } | ||
第23行: | 第23行: | ||
//调整半透明渲染模式 | //调整半透明渲染模式 | ||
spineLoaderOptions.metadata.image.alphaMode = PIXI.ALPHA_MODES.PMA | if (index != '40') | ||
spineLoaderOptions.metadata.image.alphaMode = PIXI.ALPHA_MODES.PMA; | |||
//加载播放器 | //加载播放器 | ||
第36行: | 第37行: | ||
loader = new PIXI.Loader('https://0v0.zjsnrwiki.com/gameRes/chibi/spine/'); | loader = new PIXI.Loader('https://0v0.zjsnrwiki.com/gameRes/chibi/spine/'); | ||
loader | loader.add('spineCharacter', jsonFile, spineLoaderOptions); | ||
loader.onComplete.once(onAssetsLoaded); | |||
loader.load(); | |||
let chibi = null; | let chibi = null; | ||
第85行: | 第85行: | ||
app.stage.addChild(rectangle); | app.stage.addChild(rectangle); | ||
app.stage.setChildIndex(rectangle, 0); | app.stage.setChildIndex(rectangle, 0); | ||
rectangle2 = new PIXI.Graphics(); | |||
rectangle2.beginFill(0xFFFFFF); | |||
rectangle2.drawRect(0, 0, 800, 600); | |||
rectangle2.endFill(); | |||
rectangle2.alpha = 0; | |||
rectangle2.x = 0; | |||
rectangle2.y = 0; | |||
rectangle2.cacheAsBitmap = true; | |||
app.stage.addChild(rectangle2); | |||
app.stage.setChildIndex(rectangle2, 0); | |||
}; | }; | ||
第182行: | 第193行: | ||
button4.on('pointerdown', switchGreenCurtain); | button4.on('pointerdown', switchGreenCurtain); | ||
app.stage.addChild(button4); | app.stage.addChild(button4); | ||
function switchGreenCurtain() { | function switchGreenCurtain() { | ||
rectangle.alpha == 0 ? rectangle.alpha = 1 : rectangle.alpha = 0; | rectangle.alpha == 0 ? rectangle.alpha = 1 : rectangle.alpha = 0; | ||
} | |||
//切换白幕按钮 | |||
const button5 = PIXI.Sprite.from('https://0v0.zjsnrwiki.com/images/4/44/Spine_W.png'); | |||
button5.x = 50; | |||
button5.y = 50; | |||
button5.interactive = true; | |||
button5.buttonMode = true; | |||
button5.on('pointerdown', switchWhiteCurtain); | |||
app.stage.addChild(button5); | |||
function switchWhiteCurtain() { | |||
rectangle2.alpha == 0 ? rectangle2.alpha = 1 : rectangle2.alpha = 0; | |||
} | } | ||
} | } | ||
</script> | </script> | ||
</includeonly> | </includeonly> |