◆少前百科是非盈利性、非官方的少女前线维基百科。
◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科
◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科
◆To foreigners,You can use twitter to contact us.
Icon Nyto Silver.png

“MediaWiki:Gadget-live2dnew.js”的版本间的差异

来自少前百科GFwiki
跳转至: 导航搜索
 
第1行: 第1行:
mw.loader.using('ext.gadget.pixiLive2DLoader').then( function() {
+
function initializePixiLive2d() {
window.animations.PIXILive2DLoader.init().then( function() {
+
mw.loader.using('ext.gadget.pixiLive2DLoader').then( function() {
window.animations.initApp = function(canvas, container) {
+
window.animations.PIXILive2DLoader.init().then( function() {
PIXI5.settings.RESOLUTION = window.devicePixelRatio;
+
window.animations.initApp = function( canvas, container ) {
return new PIXI5.Application({view: canvas, resizeTo: container, backgroundAlpha: 0, transparent: true});
+
PIXI5.settings.RESOLUTION = window.devicePixelRatio;
};
+
return new PIXI5.Application( {
 +
view: canvas,
 +
resizeTo: container,
 +
backgroundAlpha: 0,
 +
transparent: true,
 +
} );
 +
};
 +
} );
 
} );
 
} );
 +
}
 +
 +
mw.hook( 'wikipage.content' ).add( function ( $content ) {
 +
var $showcase = $content.find( '#unit-image-showcase' );
 +
if ( $showcase.length ) {
 +
initializePixiLive2d();
 +
}
 
} );
 
} );

2024年5月3日 (五) 15:18的最新版本

function initializePixiLive2d() {
	mw.loader.using('ext.gadget.pixiLive2DLoader').then( function() {
		window.animations.PIXILive2DLoader.init().then( function() {
			window.animations.initApp = function( canvas, container ) {
				PIXI5.settings.RESOLUTION = window.devicePixelRatio;
				return new PIXI5.Application( {
					view: canvas,
					resizeTo: container,
					backgroundAlpha: 0,
					transparent: true,
				} );
			};
		} );
	} );
}

mw.hook( 'wikipage.content' ).add( function ( $content ) {
	var $showcase = $content.find( '#unit-image-showcase' );
	if ( $showcase.length ) {
		initializePixiLive2d();
	}
} );