动画移动、帧动画事件
This commit is contained in:
parent
b40a399c80
commit
a1ffc89164
@ -837,6 +837,14 @@ action
|
|||||||
| insert_1_s
|
| insert_1_s
|
||||||
| insert_2_s
|
| insert_2_s
|
||||||
| exit_s
|
| exit_s
|
||||||
|
| setanimate_s
|
||||||
|
| deleteanimate_s
|
||||||
|
| playanimate_s
|
||||||
|
| clearanimate_s
|
||||||
|
| animateloop_s
|
||||||
|
| animatemove_s
|
||||||
|
| animatereverse_s
|
||||||
|
| animatepause_s
|
||||||
| setBlock_s
|
| setBlock_s
|
||||||
| turnBlock_s
|
| turnBlock_s
|
||||||
| showFloorImg_s
|
| showFloorImg_s
|
||||||
@ -874,6 +882,7 @@ action
|
|||||||
| follow_s
|
| follow_s
|
||||||
| unfollow_s
|
| unfollow_s
|
||||||
| animate_s
|
| animate_s
|
||||||
|
| moveAnimate_s
|
||||||
| animateResize_s
|
| animateResize_s
|
||||||
| pauseAnimate_s
|
| pauseAnimate_s
|
||||||
| remuseAnimate_s
|
| remuseAnimate_s
|
||||||
@ -1075,7 +1084,7 @@ return code+',\n';
|
|||||||
|
|
||||||
|
|
||||||
animationDrawable_s
|
animationDrawable_s
|
||||||
: '帧动画' '总显示帧数' IntString '底色' ColorString? Colour '底色不透明度' IntString? BGNL?Newline
|
: '帧动画(剧情画面)' '总显示帧数' IntString '底色' ColorString? Colour '底色不透明度' IntString? BGNL?Newline
|
||||||
'图片序列(同一帧后面覆盖先前的,默认起始帧为0,结束帧为最后一帧)'BGNL?Newline
|
'图片序列(同一帧后面覆盖先前的,默认起始帧为0,结束帧为最后一帧)'BGNL?Newline
|
||||||
'(剪裁区域不填写为全图,绘制区域不填写为全画面)'BGNL?Newline
|
'(剪裁区域不填写为全图,绘制区域不填写为全画面)'BGNL?Newline
|
||||||
'(不透明度100为不透明,默认为不透明,结束不透明度默认与开始透明度相同)'BGNL?Newline
|
'(不透明度100为不透明,默认为不透明,结束不透明度默认与开始透明度相同)'BGNL?Newline
|
||||||
@ -2398,6 +2407,212 @@ var code = '{"type": "animate", "name": "'+EvalString_0+'", "loc": "hero"'+Bool_
|
|||||||
return code;
|
return code;
|
||||||
*/;
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
animatereverse_s
|
||||||
|
: '调整正在播放的帧动画/特效 编号'IntString?'倒放'Bool'(不填编号为对所有正在进行的帧动画/特效进行操作)'
|
||||||
|
|
||||||
|
/* animatereverse_s
|
||||||
|
tooltip : animatereverse:调整正在播放的帧动画(倒放)
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["",false]
|
||||||
|
colour : this.imageColor
|
||||||
|
IntString_0 = IntString_0 ? (', "id": '+IntString_0+'') : ''
|
||||||
|
var code = '{"type": "animatereverse"'+IntString_0+',"reverse":'+Bool_0+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
animatepause_s
|
||||||
|
: '调整正在播放的帧动画/特效 编号'IntString?'暂停'Bool'(不填编号为对所有正在进行的帧动画/特效进行操作)'
|
||||||
|
|
||||||
|
/* animatepause_s
|
||||||
|
tooltip : animatereverse:调整正在播放的帧动画(暂停)
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["",false]
|
||||||
|
colour : this.imageColor
|
||||||
|
IntString_0 = IntString_0 ? (', "id": '+IntString_0+'') : ''
|
||||||
|
var code = '{"type": "animatepause"'+IntString_0+',"pause":'+Bool_0+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
setanimate_s
|
||||||
|
: '新建 帧动画/特效' '名称' EvalString '参照点偏移像素x' IntString? 'y' IntString? '动画大小 宽' IntString '高' IntString '总帧数' IntString BGNL?Newline
|
||||||
|
'图片序列(同一帧后面覆盖先前的,默认起始帧为0,结束帧为最后一帧)'BGNL?Newline
|
||||||
|
'(剪裁区域不填写为全图,绘制区域不填写为全画面)'BGNL?Newline
|
||||||
|
'(不透明度100为不透明,默认为不透明,结束透明度默认与开始不透明度相同)'BGNL?Newline
|
||||||
|
animateDrawableimage+? Newline
|
||||||
|
'音频序列(到达对应帧进行播放)'BGNL?Newline
|
||||||
|
animateDrawablesound+? Newline
|
||||||
|
|
||||||
|
/* setanimate_s
|
||||||
|
tooltip : setanimate:设置帧动画/特效(此项仅储存,不播放)
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["sword","","",192,192,60]
|
||||||
|
colour : this.imageColor
|
||||||
|
IntString_0 = IntString_0 ? (', "px": '+IntString_0+'') : '';
|
||||||
|
IntString_1 = IntString_1 ? (', "py": '+IntString_1+'') : '';
|
||||||
|
var imageList=animateDrawableimage_0?',"imageList": [\n'+animateDrawableimage_0.slice(0,-1)+'\n]':''
|
||||||
|
var soundList=animateDrawablesound_0?',"soundList": [\n'+animateDrawablesound_0.slice(0,-1)+'\n]':''
|
||||||
|
var code = '{"type": "setanimate", "name": "'+EvalString_0+'"'+IntString_0+IntString_1+' ,"width": '+IntString_2+', "height": '+IntString_3+', "allFarme": '+IntString_4+imageList+soundList+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
animateDrawableList
|
||||||
|
: animateDrawableimage
|
||||||
|
| animateDrawablesound
|
||||||
|
| animateDrawabletextEmpty;
|
||||||
|
|
||||||
|
animateDrawableimage
|
||||||
|
: '图片' EvalString? '起始帧' IntString? '起始不透明度' IntString? BGNL? Newline
|
||||||
|
'剪裁坐标cx' IntString? 'cy' IntString? '宽' IntString? '高' IntString? '绘制坐标x'IntString? 'y' IntString? '宽' IntString? '高' IntString?'旋转角度'IntString? BGNL? Newline
|
||||||
|
'结束帧' IntString? '结束不透明度' IntString? '剪裁坐标cx' IntString? 'cy' IntString? '宽' IntString? '高' IntString? '绘制坐标x'IntString? 'y' IntString? '宽' IntString? '高' IntString?'旋转角度'IntString? Newline
|
||||||
|
/* animateDrawableimage
|
||||||
|
tooltip : 帧动画图片列表
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["","","","","","","","","","","","","","","","","","","","","","",""]
|
||||||
|
colour : this.subColor
|
||||||
|
allImages : ['EvalString_0']
|
||||||
|
if (IntString_1&&(IntString_1 < 0||IntString_1>100)) throw new Error('不透明度范围为0-100,0为透明,100为不透明,不填默认为不透明')
|
||||||
|
if (IntString_12&&(IntString_12 < 0||IntString_12>100)) throw new Error('不透明度范围为0-100,0为透明,100为不透明,不填默认为不透明')
|
||||||
|
IntString_0 = IntString_0 ? (', "beforefarme": '+IntString_0+'') : '';
|
||||||
|
IntString_1 = IntString_1 ? (', "globalAlpha": '+IntString_1+'') : '';
|
||||||
|
IntString_2 = IntString_2 ? (', "cx": '+IntString_2+'') : '';
|
||||||
|
IntString_3 = IntString_3 ? (', "cy": '+IntString_3+'') : '';
|
||||||
|
IntString_4 = IntString_4 ? (', "cw": '+IntString_4+'') : '';
|
||||||
|
IntString_5 = IntString_5 ? (', "ch": '+IntString_5+'') : '';
|
||||||
|
IntString_6 = IntString_6 ? (', "x": '+IntString_6+'') : '';
|
||||||
|
IntString_7 = IntString_7 ? (', "y": '+IntString_7+'') : '';
|
||||||
|
IntString_8 = IntString_8 ? (', "w": '+IntString_8+'') : '';
|
||||||
|
IntString_9 = IntString_9 ? (', "h": '+IntString_9+'') : '';
|
||||||
|
IntString_10 = IntString_10 ? (', "angle": '+IntString_10+'') : '';
|
||||||
|
|
||||||
|
IntString_11 = IntString_11 ? (', "afterfarme": '+IntString_11+'') : '';
|
||||||
|
IntString_12 = IntString_12 ? (', "aglobalAlpha": '+IntString_12+'') : '';
|
||||||
|
IntString_13 = IntString_13 ? (', "acx": '+IntString_13+'') : '';
|
||||||
|
IntString_14 = IntString_14 ? (', "acy": '+IntString_14+'') : '';
|
||||||
|
IntString_15 = IntString_15? (', "acw": '+IntString_15+'') : '';
|
||||||
|
IntString_16 = IntString_16 ? (', "ach": '+IntString_16+'') : '';
|
||||||
|
IntString_17 = IntString_17 ? (', "ax": '+IntString_17+'') : '';
|
||||||
|
IntString_18 = IntString_18 ? (', "ay": '+IntString_18+'') : '';
|
||||||
|
IntString_19 = IntString_19 ? (', "aw": '+IntString_19+'') : '';
|
||||||
|
IntString_20 = IntString_20 ? (', "ah": '+IntString_20+'') : '';
|
||||||
|
IntString_21 = IntString_21 ? (', "aangle": '+IntString_21+'') : '';
|
||||||
|
return '{ "image":"'+EvalString_0+'"'+IntString_0+IntString_1+IntString_2+IntString_3+IntString_4+IntString_5+IntString_6+IntString_7+IntString_8+IntString_9+IntString_10+IntString_11+IntString_12+IntString_13+IntString_14+IntString_15+IntString_16+IntString_17+IntString_18+IntString_19+IntString_20+IntString_21+'},'
|
||||||
|
*/;
|
||||||
|
|
||||||
|
animateDrawablesound
|
||||||
|
: '音效' EvalString? '起始帧' IntString '是否停止其他音效'Bool Newline
|
||||||
|
|
||||||
|
/* animateDrawablesound
|
||||||
|
tooltip : 帧动画配音
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["",0,false]
|
||||||
|
colour : this.subColor
|
||||||
|
allSounds : ['EvalString_0']
|
||||||
|
|
||||||
|
return '{ "sound":"'+EvalString_0+'","startfarme":'+IntString_0+',"stopbefore":'+Bool_0+'},'
|
||||||
|
*/;
|
||||||
|
|
||||||
|
animateDrawabletextEmpty
|
||||||
|
: Newline
|
||||||
|
|
||||||
|
/* animateDrawabletextEmpty
|
||||||
|
var code = [];
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
deleteanimate_s
|
||||||
|
: '删除 帧动画/特效' '名称' EvalString Newline
|
||||||
|
|
||||||
|
/* deleteanimate_s
|
||||||
|
tooltip : deleteanimate:删除储存的帧动画
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["zone"]
|
||||||
|
|
||||||
|
colour : this.imageColor
|
||||||
|
|
||||||
|
var code = '{"type": "deleteanimate", "name": "'+EvalString_0+'"},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
playanimate_s
|
||||||
|
: '播放 帧动画/特效' '名称' EvalString '编号'IntString?'像素x' IntString? 'y' IntString? '跟随勇士' Bool 'x方向缩放' EvalString? 'y方向缩放'EvalString?'循环'Bool'倒放'Bool Newline
|
||||||
|
|
||||||
|
/* playanimate_s
|
||||||
|
tooltip : playanimate:播放帧动画,选择跟随勇士后x、y将失效改为勇士中心坐标
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["zone","","","",false,1,1,false,false]
|
||||||
|
previewBlock : true
|
||||||
|
colour : this.imageColor
|
||||||
|
IntString_0 = IntString_0 ? (', "id": '+IntString_0+'') : '';
|
||||||
|
IntString_1 = IntString_1 ? (', "x": '+IntString_1+'') : '';
|
||||||
|
IntString_2 = IntString_2 ? (', "y": '+IntString_2+'') : '';
|
||||||
|
if(EvalString_1&&!/^(0|([1-9][0-9]*))(\.[\d]+)?$/.test(EvalString_1))throw new Error("此项仅能填写小数、整数或不填");
|
||||||
|
if(EvalString_2&&!/^(0|([1-9][0-9]*))(\.[\d]+)?$/.test(EvalString_2))throw new Error("此项仅能填写小数、整数或不填");
|
||||||
|
EvalString_1 = EvalString_1 ? (', "scalex": '+EvalString_1+'') : '';
|
||||||
|
EvalString_2 = EvalString_2 ? (', "scaley": '+EvalString_2+'') : '';
|
||||||
|
var code = '{"type": "playanimate", "name": "'+EvalString_0+'"'+IntString_0+IntString_1+IntString_2+',"hero":'+Bool_0+EvalString_1+EvalString_2+',"loop":'+Bool_1+',"reverse":'+Bool_2+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
clearanimate_s
|
||||||
|
: '停止正在播放的帧动画/特效 编号'IntString?'(不填编号为对所有正在进行的帧动画/特效进行操作)'
|
||||||
|
|
||||||
|
/* clearanimate_s
|
||||||
|
tooltip : clearanimate:清空正在播放的帧动画
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : [""]
|
||||||
|
colour : this.imageColor
|
||||||
|
IntString_0 = IntString_0 ? (', "id": '+IntString_0+'') : '';
|
||||||
|
var code = '{"type": "clearanimate"'+IntString_0+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
animateloop_s
|
||||||
|
: '调整正在播放的帧动画/特效 编号'IntString?'循环'Bool '(不填编号为对所有正在进行的帧动画/特效进行操作)'
|
||||||
|
|
||||||
|
/* animateloop_s
|
||||||
|
tooltip : animateloop:调整正在播放的帧动画(循环)
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : ["",false]
|
||||||
|
colour : this.imageColor
|
||||||
|
IntString_0 = IntString_0 ? (', "id": '+IntString_0+'') : ''
|
||||||
|
var code = '{"type": "animateloop"'+IntString_0+',"loop":'+Bool_0+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
animatemove_s
|
||||||
|
: '移动正在播放的帧动画/特效 编号'IntString'目标像素x'PosString'y'PosString'移动时长'PosString'移动模式'MoveMode2_List? '(仅可对有编号的非跟随勇士帧动画/特效使用)'
|
||||||
|
|
||||||
|
/* animatemove_s
|
||||||
|
tooltip : animateloop:调整正在播放的帧动画(循环)
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : [0,0,0,1000,'']
|
||||||
|
previewBlock : true
|
||||||
|
colour : this.imageColor
|
||||||
|
IntString_0 = IntString_0 ? (', "id": '+IntString_0+'') : ''
|
||||||
|
MoveMode2_List_0=MoveMode2_List_0?(', "style": "'+MoveMode2_List_0+'"') : ''
|
||||||
|
var code = '{"type": "animatemove"'+IntString_0+',"px":'+PosString_0+',"py":'+PosString_1+',"time":'+PosString_2+MoveMode2_List_0+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
moveAnimate_s
|
||||||
|
: '移动正在播放的帧动画/特效 编号'IntString'目标像素x'PosString'y'PosString'移动时长'PosString'移动模式'MoveMode2_List? '(仅可对有编号的非跟随勇士动画使用)'
|
||||||
|
|
||||||
|
/* moveAnimate_s
|
||||||
|
tooltip : animateloop:调整正在播放的帧动画(循环)
|
||||||
|
helpUrl : /_docs/#/instruction
|
||||||
|
default : [0,0,0,1000,'']
|
||||||
|
previewBlock : true
|
||||||
|
colour : this.soundColor
|
||||||
|
IntString_0 = IntString_0 ? (', "id": '+IntString_0+'') : ''
|
||||||
|
MoveMode2_List_0=MoveMode2_List_0?(', "style": "'+MoveMode2_List_0+'"') : ''
|
||||||
|
var code = '{"type": "moveAnimate"'+IntString_0+',"px":'+PosString_0+',"py":'+PosString_1+',"time":'+PosString_2+MoveMode2_List_0+'},\n';
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
|
|
||||||
animateResize_s
|
animateResize_s
|
||||||
: '显示动画(60Fps)' EvalString '编号'PosString? '中心像素' 'x' PosString? 'y' PosString?'以勇士为中心' Bool'倒放' Bool'循环'Bool'不等待执行完毕' Bool Newline
|
: '显示动画(60Fps)' EvalString '编号'PosString? '中心像素' 'x' PosString? 'y' PosString?'以勇士为中心' Bool'倒放' Bool'循环'Bool'不等待执行完毕' Bool Newline
|
||||||
|
|
||||||
@ -4614,6 +4829,10 @@ MoveMode_List
|
|||||||
: '匀速移动'|'缓入快出'|'快入缓出'|'缓入缓出'|'随机'
|
: '匀速移动'|'缓入快出'|'快入缓出'|'缓入缓出'|'随机'
|
||||||
/*MoveMode_List ['', 'easeIn', 'easeOut', 'easeInOut', 'random']*/;
|
/*MoveMode_List ['', 'easeIn', 'easeOut', 'easeInOut', 'random']*/;
|
||||||
|
|
||||||
|
MoveMode2_List
|
||||||
|
: '匀速移动'|'慢-快'|'快-慢'|'慢-快-慢'|'快-慢-快'
|
||||||
|
/*MoveMode2_List ['', 'in', 'out', 'in-out', 'center']*/;
|
||||||
|
|
||||||
NameMap_List
|
NameMap_List
|
||||||
: '确定'|'取消'|'操作失败'|'光标移动'|'打开界面'|'读档'|'存档'|'获得道具'|'回血'|'宝石'|'炸弹'|'飞行器'|'开关门'|'上下楼'|'跳跃'|'破墙镐'|'破冰镐'|'阻激夹域'|'穿脱装备'|'商店'
|
: '确定'|'取消'|'操作失败'|'光标移动'|'打开界面'|'读档'|'存档'|'获得道具'|'回血'|'宝石'|'炸弹'|'飞行器'|'开关门'|'上下楼'|'跳跃'|'破墙镐'|'破冰镐'|'阻激夹域'|'穿脱装备'|'商店'
|
||||||
/*NameMap_List ['确定','取消','操作失败','光标移动','打开界面','读档','存档','获得道具','回血','宝石','炸弹','飞行器','开关门','上下楼','跳跃','破墙镐','破冰镐','阻激夹域','穿脱装备','商店']*/;
|
/*NameMap_List ['确定','取消','操作失败','光标移动','打开界面','读档','存档','获得道具','回血','宝石','炸弹','飞行器','开关门','上下楼','跳跃','破墙镐','破冰镐','阻激夹域','穿脱装备','商店']*/;
|
||||||
|
@ -1191,6 +1191,126 @@ MotaActionParser = function () {
|
|||||||
this.next,
|
this.next,
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
case "setanimate":
|
||||||
|
var buildanimateDrawableimage = function (obj) {
|
||||||
|
obj = MotaActionFunctions.processanimateDrawableimage(obj || []);
|
||||||
|
var res = null;
|
||||||
|
for (var ii = obj.length - 1, one; (one = obj[ii]); ii--) {
|
||||||
|
res = MotaActionBlocks["animateDrawableimage"].xmlText([
|
||||||
|
one[0],
|
||||||
|
one[1],
|
||||||
|
one[2],
|
||||||
|
one[3],
|
||||||
|
one[4],
|
||||||
|
one[5],
|
||||||
|
one[6],
|
||||||
|
one[7],
|
||||||
|
one[8],
|
||||||
|
one[9],
|
||||||
|
one[10],
|
||||||
|
one[11],
|
||||||
|
one[12],
|
||||||
|
one[13],
|
||||||
|
one[14],
|
||||||
|
one[15],
|
||||||
|
one[16],
|
||||||
|
one[17],
|
||||||
|
one[18],
|
||||||
|
one[19],
|
||||||
|
one[20],
|
||||||
|
one[21],
|
||||||
|
one[22],
|
||||||
|
res,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
var buildanimateDrawablesound = function (obj) {
|
||||||
|
obj = MotaActionFunctions.processanimateDrawablesound(obj || []);
|
||||||
|
var res = null;
|
||||||
|
for (var ii = obj.length - 1, one; (one = obj[ii]); ii--) {
|
||||||
|
res = MotaActionBlocks["animateDrawablesound"].xmlText([
|
||||||
|
one[0],
|
||||||
|
one[1],
|
||||||
|
one[2],
|
||||||
|
res,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
this.next = MotaActionBlocks["setanimate_s"].xmlText([
|
||||||
|
data.name,
|
||||||
|
data.px,
|
||||||
|
data.py,
|
||||||
|
data.width,
|
||||||
|
data.height,
|
||||||
|
data.allFarme,
|
||||||
|
buildanimateDrawableimage(data.imageList),
|
||||||
|
buildanimateDrawablesound(data.soundList),
|
||||||
|
this.next,
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case "clearanimate":
|
||||||
|
this.next = MotaActionBlocks["clearanimate_s"].xmlText([
|
||||||
|
data.id||"",
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "animateloop":
|
||||||
|
this.next = MotaActionBlocks["animateloop_s"].xmlText([
|
||||||
|
data.id||"",
|
||||||
|
data.loop,
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "animatemove":
|
||||||
|
this.next = MotaActionBlocks["animatemove_s"].xmlText([
|
||||||
|
data.id||0,
|
||||||
|
data.px||0,
|
||||||
|
data.py||0,
|
||||||
|
data.time||0,
|
||||||
|
data.style||"",
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "moveAnimate":
|
||||||
|
this.next = MotaActionBlocks["moveAnimate_s"].xmlText([
|
||||||
|
data.id||0,
|
||||||
|
data.px||0,
|
||||||
|
data.py||0,
|
||||||
|
data.time||0,
|
||||||
|
data.style||"",
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "animatereverse":
|
||||||
|
this.next = MotaActionBlocks["animatereverse_s"].xmlText([
|
||||||
|
data.id||"",
|
||||||
|
data.reverse,
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "animatepause":
|
||||||
|
this.next = MotaActionBlocks["animatepause_s"].xmlText([
|
||||||
|
data.id||"",
|
||||||
|
data.pause,
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
|
case "deleteanimate":
|
||||||
|
this.next = MotaActionBlocks["deleteanimate_s"].xmlText([
|
||||||
|
data.name,
|
||||||
|
this.next,
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case "playanimate":
|
||||||
|
this.next = MotaActionBlocks["playanimate_s"].xmlText([
|
||||||
|
data.name,
|
||||||
|
data.id||"",
|
||||||
|
data.x,
|
||||||
|
data.y,
|
||||||
|
data.hero,
|
||||||
|
data.scalex||1,
|
||||||
|
data.scaley||1,
|
||||||
|
data.loop||false,
|
||||||
|
data.reverse||false,
|
||||||
|
this.next,
|
||||||
|
]);
|
||||||
|
break;
|
||||||
case "setViewport": // 设置视角
|
case "setViewport": // 设置视角
|
||||||
if (data.dxy) {
|
if (data.dxy) {
|
||||||
this.next = MotaActionBlocks["setViewport_1_s"].xmlText([
|
this.next = MotaActionBlocks["setViewport_1_s"].xmlText([
|
||||||
@ -2874,6 +2994,45 @@ MotaActionParser = function () {
|
|||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MotaActionFunctions.processanimateDrawableimage = function (overList) {
|
||||||
|
var list = [];
|
||||||
|
overList.forEach(function (one) {
|
||||||
|
list.push([
|
||||||
|
one.image,
|
||||||
|
one.beforefarme,
|
||||||
|
one.globalAlpha,
|
||||||
|
one.cx,
|
||||||
|
one.cy,
|
||||||
|
one.cw,
|
||||||
|
one.ch,
|
||||||
|
one.x,
|
||||||
|
one.y,
|
||||||
|
one.w,
|
||||||
|
one.h,
|
||||||
|
one.angle,
|
||||||
|
one.afterfarme,
|
||||||
|
one.aglobalAlpha,
|
||||||
|
one.acx,
|
||||||
|
one.acy,
|
||||||
|
one.acw,
|
||||||
|
one.ach,
|
||||||
|
one.ax,
|
||||||
|
one.ay,
|
||||||
|
one.aw,
|
||||||
|
one.ah,
|
||||||
|
one.aangle,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
};
|
||||||
|
MotaActionFunctions.processanimateDrawablesound = function (overList) {
|
||||||
|
var list = [];
|
||||||
|
overList.forEach(function (one) {
|
||||||
|
list.push([one.sound, one.startfarme, one.stopbefore]);
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
};
|
||||||
MotaActionFunctions.processovertext = function (overList) {
|
MotaActionFunctions.processovertext = function (overList) {
|
||||||
var list = [];
|
var list = [];
|
||||||
overList.forEach(function (one) {
|
overList.forEach(function (one) {
|
||||||
|
@ -359,6 +359,16 @@ editor_blockly = function () {
|
|||||||
editor.uievent.previewUI([{ type: "fillRect", x:obj.centerX-5, y: obj.centerY-5, width:10, height: 10, style:"#FF0000"}]);
|
editor.uievent.previewUI([{ type: "fillRect", x:obj.centerX-5, y: obj.centerY-5, width:10, height: 10, style:"#FF0000"}]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'playanimate_s': // 显示帧动画
|
||||||
|
if (obj.name && obj.x&&obj.y) {
|
||||||
|
editor.uievent.previewUI([{ type: "fillRect", x:obj.x-5, y: obj.y-5, width:10, height: 10, style:"#FF0000"}]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'animatemove_s': // 移动帧动画
|
||||||
|
|
||||||
|
editor.uievent.previewUI([{ type: "fillRect", x:obj.px-5, y: obj.py-5, width:10, height: 10, style:"#FF0000"}]);
|
||||||
|
|
||||||
|
break;
|
||||||
case 'setCurtain_0_s': // 更改色调
|
case 'setCurtain_0_s': // 更改色调
|
||||||
if (obj.color) {
|
if (obj.color) {
|
||||||
editor.uievent.previewUI([{ type: "fillRect", x: 0, y: 0, width: core.__PIXELS__, height: core.__PIXELS__, style: obj.color }]);
|
editor.uievent.previewUI([{ type: "fillRect", x: 0, y: 0, width: core.__PIXELS__, height: core.__PIXELS__, style: obj.color }]);
|
||||||
|
@ -73,6 +73,78 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.doAction();
|
core.doAction();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
core.registerEvent("setanimate", function (data) {
|
||||||
|
data.px = data.px ?? 0;
|
||||||
|
data.py = data.py ?? 0;
|
||||||
|
core.setanimate(
|
||||||
|
data.name,
|
||||||
|
data.px,
|
||||||
|
data.py,
|
||||||
|
data.width,
|
||||||
|
data.height,
|
||||||
|
data.allFarme,
|
||||||
|
data.imageList,
|
||||||
|
data.soundList
|
||||||
|
);
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
core.registerEvent("animatemove", function (data) {
|
||||||
|
core.animatemove(data.id, data.px, data.py, data.time, data.style);
|
||||||
|
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
core.registerEvent("moveAnimate", function (data) {
|
||||||
|
core.maps.moveAnimate(data.id, data.px, data.py, data.time, data.style);
|
||||||
|
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
|
||||||
|
core.registerEvent("animateloop", function (data) {
|
||||||
|
core.animateloop(data.id, data.loop);
|
||||||
|
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
core.registerEvent("animatereverse", function (data) {
|
||||||
|
core.animatereverse(data.id, data.reverse);
|
||||||
|
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
core.registerEvent("animatepause", function (data) {
|
||||||
|
core.animatepause(data.id, data.pause);
|
||||||
|
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
core.registerEvent("clearanimate", function (data) {
|
||||||
|
core.animateclear(data.id);
|
||||||
|
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
core.registerEvent("deleteanimate", function (data) {
|
||||||
|
core.deleteanimate(data.name);
|
||||||
|
core.doAction();
|
||||||
|
});
|
||||||
|
core.registerEvent("playanimate", function (data) {
|
||||||
|
if (!main.replayChecking && !core.isReplaying()) {
|
||||||
|
data.x = data.x ?? 0;
|
||||||
|
data.y = data.y ?? 0;
|
||||||
|
data.scalex = data.scalex ?? 1;
|
||||||
|
data.scaley = data.scaley ?? 1;
|
||||||
|
core.playanimate(
|
||||||
|
data.name,
|
||||||
|
data.id,
|
||||||
|
data.x,
|
||||||
|
data.y,
|
||||||
|
data.hero,
|
||||||
|
data.scalex,
|
||||||
|
data.scaley,
|
||||||
|
data.loop,
|
||||||
|
data.reverse
|
||||||
|
);
|
||||||
|
core.doAction();
|
||||||
|
} else {
|
||||||
|
core.doAction();
|
||||||
|
}
|
||||||
|
});
|
||||||
core.registerEvent("addPop", function (data) {
|
core.registerEvent("addPop", function (data) {
|
||||||
if (!main.replayChecking && !core.isReplaying()) {
|
if (!main.replayChecking && !core.isReplaying()) {
|
||||||
data.value = core.replaceText(data.value);
|
data.value = core.replaceText(data.value);
|
||||||
@ -12400,6 +12472,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
MotaActionBlocks["animate_s"].xmlText(),
|
MotaActionBlocks["animate_s"].xmlText(),
|
||||||
MotaActionBlocks["animate_1_s"].xmlText(),
|
MotaActionBlocks["animate_1_s"].xmlText(),
|
||||||
MotaActionBlocks["animateResize_s"].xmlText(),
|
MotaActionBlocks["animateResize_s"].xmlText(),
|
||||||
|
MotaActionBlocks["moveAnimate_s"].xmlText(),
|
||||||
MotaActionBlocks["pauseAnimate_s"].xmlText(),
|
MotaActionBlocks["pauseAnimate_s"].xmlText(),
|
||||||
MotaActionBlocks["remuseAnimate_s"].xmlText(),
|
MotaActionBlocks["remuseAnimate_s"].xmlText(),
|
||||||
MotaActionBlocks["stopAnimate_s"].xmlText(),
|
MotaActionBlocks["stopAnimate_s"].xmlText(),
|
||||||
@ -12421,6 +12494,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
],
|
],
|
||||||
音像处理: [
|
音像处理: [
|
||||||
MotaActionBlocks["animationDrawable_s"].xmlText(),
|
MotaActionBlocks["animationDrawable_s"].xmlText(),
|
||||||
|
MotaActionBlocks["setanimate_s"].xmlText(),
|
||||||
|
MotaActionBlocks["deleteanimate_s"].xmlText(),
|
||||||
|
MotaActionBlocks["playanimate_s"].xmlText(),
|
||||||
|
MotaActionBlocks["clearanimate_s"].xmlText(),
|
||||||
|
MotaActionBlocks["animateloop_s"].xmlText(),
|
||||||
|
MotaActionBlocks["animatereverse_s"].xmlText(),
|
||||||
|
MotaActionBlocks["animatepause_s"].xmlText(),
|
||||||
|
MotaActionBlocks["animatemove_s"].xmlText(),
|
||||||
MotaActionBlocks["introAndLoop_s"].xmlText(),
|
MotaActionBlocks["introAndLoop_s"].xmlText(),
|
||||||
MotaActionBlocks["showImage_s"].xmlText(),
|
MotaActionBlocks["showImage_s"].xmlText(),
|
||||||
MotaActionBlocks["showImage_1_s"].xmlText(),
|
MotaActionBlocks["showImage_1_s"].xmlText(),
|
||||||
@ -25559,6 +25640,31 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
},
|
},
|
||||||
"动画": function () {
|
"动画": function () {
|
||||||
// 在此增加新插件
|
// 在此增加新插件
|
||||||
|
const { Transition, linear, bezier, circle, hyper, trigo, power, inverseTrigo, shake, sleep } = core.plugin.animate;
|
||||||
|
//////移动动画//////
|
||||||
|
const tran = new Transition();
|
||||||
|
maps.prototype.moveAnimate = function (id, px, py, time, style) {
|
||||||
|
if (!id) return
|
||||||
|
core.status.animateObjs.forEach(v => {
|
||||||
|
if (v.id === id) {
|
||||||
|
if (v.hero) return
|
||||||
|
if (!style) tran.mode(linear())
|
||||||
|
else if (style === "in") {
|
||||||
|
tran.mode(trigo('sin', "in"))
|
||||||
|
} else if (style === "out") {
|
||||||
|
tran.mode(trigo('sin', "out"))
|
||||||
|
} else if (style === "in-out") {
|
||||||
|
tran.mode(trigo('sin', "in-out"))
|
||||||
|
} else if (style === "center") {
|
||||||
|
tran.mode(trigo('sin', "center"))
|
||||||
|
}
|
||||||
|
tran.time(time)
|
||||||
|
tran.value[v.id + v.name + "x"] = px
|
||||||
|
tran.value[v.id + v.name + "y"] = py
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
control.prototype._animationFrame_animate = function (timestamp) {
|
control.prototype._animationFrame_animate = function (timestamp) {
|
||||||
let frametime = timestamp - core.animateFrame.animateTime
|
let frametime = timestamp - core.animateFrame.animateTime
|
||||||
@ -25618,11 +25724,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.maps._drawAnimateFrame('animate', obj.animate, herox, heroy, obj.index);
|
core.maps._drawAnimateFrame('animate', obj.animate, herox, heroy, obj.index);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
core.maps._drawAnimateFrame('animate', obj.animate, obj.centerX, obj.centerY, obj.index);
|
core.maps._drawAnimateFrame('animate', obj.animate, tran.value[obj.id + obj.name + "x"], tran.value[obj.id + obj.name + "y"], obj.index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
core.registerAnimationFrame("animate", true, core.control._animationFrame_animate);
|
core.registerAnimationFrame("animate", true, core.control._animationFrame_animate);
|
||||||
|
|
||||||
////// 绘制动画 //////
|
////// 绘制动画 //////
|
||||||
maps.prototype.drawAnimate = function (name, x, y, alignWindow, callback) {
|
maps.prototype.drawAnimate = function (name, x, y, alignWindow, callback) {
|
||||||
name = core.getMappedName(name);
|
name = core.getMappedName(name);
|
||||||
@ -25643,7 +25750,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
}
|
}
|
||||||
animate.se = animate.se || {};
|
animate.se = animate.se || {};
|
||||||
if (typeof animate.se == 'string') animate.se = { 1: animate.se };
|
if (typeof animate.se == 'string') animate.se = { 1: animate.se };
|
||||||
|
tran.mode(linear()).time(1)
|
||||||
|
tran.value[id + name + "x"] = centerX
|
||||||
|
tran.value[id + name + "y"] = centerY
|
||||||
var id = setTimeout(null);
|
var id = setTimeout(null);
|
||||||
core.status.animateObjs.push({
|
core.status.animateObjs.push({
|
||||||
"name": name,
|
"name": name,
|
||||||
@ -25680,6 +25789,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
if (typeof animate.se == 'string') animate.se = { 1: animate.se };
|
if (typeof animate.se == 'string') animate.se = { 1: animate.se };
|
||||||
|
|
||||||
var id = id || setTimeout(null);
|
var id = id || setTimeout(null);
|
||||||
|
tran.mode(linear()).time(1)
|
||||||
|
if (!hero) tran.value[id + name + "x"] = centerX
|
||||||
|
if (!hero) tran.value[id + name + "y"] = centerY
|
||||||
if (hero) core.status.animateObjs.push({
|
if (hero) core.status.animateObjs.push({
|
||||||
"name": name,
|
"name": name,
|
||||||
"id": id,
|
"id": id,
|
||||||
@ -25820,5 +25932,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
if (core.status.animateObjs.length == 0)
|
if (core.status.animateObjs.length == 0)
|
||||||
core.clearMap('animate');
|
core.clearMap('animate');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"帧动画(游戏画面)": null
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user