加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我在自己联系写MV的脚本,
谢了一个基本上没人能看懂,不过能运行的脚本,
现在我想在游戏里面使用事件来更换脚本里面的一个图片,怎么写都不能达到效果,
在这里求助一下大神,帮我看看,要怎么改一下,下面是脚本/*: * @default * @param tihuantup * @desc 在这里输入图片名称。 * @default * */ ////HUD代码 (function(){ var oldSceneMap_start = Scene_Map.prototype.start; Scene_Map.prototype.start = function(){ oldSceneMap_start.call(this); this.createCunstomHudWindow(); }; Scene_Map.prototype.createCunstomHudWindow = function(x, y, width, height) { var bcbc=0; var parameters = PluginManager.parameters('HUD'); var tihuantup = String(parameters["xintiaoshang"]||"xintiaoshang"); //这上面是我自己加的更换图片,可是怎么做都能改 var xinshang = new Sprite(ImageManager.loadPicture(tihuantup)); //var xinshang = new Sprite(ImageManager.loadPicture("xintiaoshang")); var xin3 = new Sprite(ImageManager.loadPicture("xue")); var xinzang = new Sprite(ImageManager.loadPicture("xin")); var tili2 = new Sprite(ImageManager.loadPicture("tilixia")); var tili1 = new Sprite(ImageManager.loadPicture("tilishang")); var siwang = new Sprite(ImageManager.loadPicture("siwang")); this.addChild(tili2); this.addChild(xinshang); this.addChild(xinzang); this.addChild(xin3); this.addChild(tili1); this.addChild(siwang); xinshang.y = 522; xinzang.opacity = 0 ; xin3.y = 620; tili2.y = 520; tili1.y = 520; siwang.opacity = 0; xin3.update = function() { var renwushux = $gameParty.leader(); Sprite.prototype.update.call(this); var a = 523 + renwushux.hp ; var b = 620 - renwushux.mp; if(xin3.y < a) { xin3.y += 1; } else if(xin3.y >a) { xin3.y -=1; } if(tili2.y < b) { tili2.y += 1; } else if(tili2.y > b) { tili2.y -= 1; } } xinzang.update = function() { Sprite.prototype.update.call(this); ConfigManager.alwaysDash = true; var renwu = $gameParty.leader(); if(renwu.hp <= 60) { if(xinzang.opacity >= 250||xinzang.x >=0) { xinzang.x -= 0.5; xinzang.opacity -= 10; if(xinzang.x == 8) { var audio = {name:"0-xintiao",pitch:100,volume:100,pan:0}; AudioManager.playSe(audio); var aaa = {color:(255,255,255,255),duration:10}; } } else if(xinzang.opacity<= 200||xinzang.x <=0) { xinzang.x = 40; xinzang.opacity = 255; $gameScreen.startFlash([255, 0, 0, 50],10); } if(renwu.hp <= 20) { if(xinzang.opacity >= 250||xinzang.x >=0) { xinzang.x -= 0.5; xinzang.opacity -= 10; if(xinzang.x == 17) { var audio = {name:"0-xintiao",pitch:100,volume:90,pan:0}; AudioManager.playSe(audio); } } else if(xinzang.opacity<= 200||xinzang.x <=0) { xinzang.x = 40; xinzang.opacity = 255; $gameScreen.startFlash([255, 0, 0, 100],20); } } if(renwu.hp <=0) { bcbc += 1; siwang.opacity = 255; } if(bcbc == 1) { var audio11 = {name:"1-nvcanjiao2",pitch:110,volume:80,pan:0}; AudioManager.playSe(audio11); } } else { if(xinzang.opacity >= 250||xinzang.x >=0) { xinzang.x -= 0.3; xinzang.opacity -= 10; } else if(xinzang.opacity<= 200||xinzang.x <=0) { xinzang.x = 40; xinzang.opacity = 255; } } } } })();
/*:
* @default
* @param tihuantup
* @desc 在这里输入图片名称。
* @default
* */
////HUD代码
(function(){
var oldSceneMap_start = Scene_Map.prototype.start;
Scene_Map.prototype.start = function(){
oldSceneMap_start.call(this);
this.createCunstomHudWindow();
};
Scene_Map.prototype.createCunstomHudWindow = function(x, y, width, height)
{
var bcbc=0;
var parameters = PluginManager.parameters('HUD');
var tihuantup = String(parameters["xintiaoshang"]||"xintiaoshang");
//这上面是我自己加的更换图片,可是怎么做都能改
var xinshang = new Sprite(ImageManager.loadPicture(tihuantup));
//var xinshang = new Sprite(ImageManager.loadPicture("xintiaoshang"));
var xin3 = new Sprite(ImageManager.loadPicture("xue"));
var xinzang = new Sprite(ImageManager.loadPicture("xin"));
var tili2 = new Sprite(ImageManager.loadPicture("tilixia"));
var tili1 = new Sprite(ImageManager.loadPicture("tilishang"));
var siwang = new Sprite(ImageManager.loadPicture("siwang"));
this.addChild(tili2);
this.addChild(xinshang);
this.addChild(xinzang);
this.addChild(xin3);
this.addChild(tili1);
this.addChild(siwang);
xinshang.y = 522;
xinzang.opacity = 0 ;
xin3.y = 620;
tili2.y = 520;
tili1.y = 520;
siwang.opacity = 0;
xin3.update = function()
{
var renwushux = $gameParty.leader();
Sprite.prototype.update.call(this);
var a = 523 + renwushux.hp ;
var b = 620 - renwushux.mp;
if(xin3.y < a)
{
xin3.y += 1;
}
else if(xin3.y >a)
{
xin3.y -=1;
}
if(tili2.y < b)
{
tili2.y += 1;
}
else if(tili2.y > b)
{
tili2.y -= 1;
}
}
xinzang.update = function()
{
Sprite.prototype.update.call(this);
ConfigManager.alwaysDash = true;
var renwu = $gameParty.leader();
if(renwu.hp <= 60)
{
if(xinzang.opacity >= 250||xinzang.x >=0)
{
xinzang.x -= 0.5;
xinzang.opacity -= 10;
if(xinzang.x == 8)
{
var audio = {name:"0-xintiao",pitch:100,volume:100,pan:0};
AudioManager.playSe(audio);
var aaa = {color:(255,255,255,255),duration:10};
}
}
else if(xinzang.opacity<= 200||xinzang.x <=0)
{
xinzang.x = 40;
xinzang.opacity = 255;
$gameScreen.startFlash([255, 0, 0, 50],10);
}
if(renwu.hp <= 20)
{
if(xinzang.opacity >= 250||xinzang.x >=0)
{
xinzang.x -= 0.5;
xinzang.opacity -= 10;
if(xinzang.x == 17)
{
var audio = {name:"0-xintiao",pitch:100,volume:90,pan:0};
AudioManager.playSe(audio);
}
}
else if(xinzang.opacity<= 200||xinzang.x <=0)
{
xinzang.x = 40;
xinzang.opacity = 255;
$gameScreen.startFlash([255, 0, 0, 100],20);
}
}
if(renwu.hp <=0)
{
bcbc += 1;
siwang.opacity = 255;
}
if(bcbc == 1)
{
var audio11 = {name:"1-nvcanjiao2",pitch:110,volume:80,pan:0};
AudioManager.playSe(audio11);
}
}
else
{
if(xinzang.opacity >= 250||xinzang.x >=0)
{
xinzang.x -= 0.3;
xinzang.opacity -= 10;
}
else if(xinzang.opacity<= 200||xinzang.x <=0)
{
xinzang.x = 40;
xinzang.opacity = 255;
}
}
}
}
})();
|