Commit 0b317c13 authored by rockyl's avatar rockyl

飞入飞出增加inPos参数,用来指示坐标

parent fdd5f93c
...@@ -76,10 +76,10 @@ const effects = { ...@@ -76,10 +76,10 @@ const effects = {
} }
}, },
flew(params, mutex, lastView, view, container, callback) { flew(params, mutex, lastView, view, container, callback) {
const {duration = 300, direction = 'top', ease = 'backOut'} = params; const {duration = 300, direction = 'top', ease = 'backOut', inPos: inPosInput} = params;
const {stage: {width, height}} = gameStage; const {stage: {width, height}} = gameStage;
let outPos: any = {}; let outPos: any;
switch (direction) { switch (direction) {
case 'left': case 'left':
outPos.x = -width; outPos.x = -width;
...@@ -128,8 +128,8 @@ const effects = { ...@@ -128,8 +128,8 @@ const effects = {
function flewIn(callback) { function flewIn(callback) {
if (view) { if (view) {
let inPos: any = { let inPos: any = {
x: view.x, x: inPosInput && inPosInput.hasOwnProperty('x') ? inPosInput.x : view.x,
y: view.y, y: inPosInput && inPosInput.hasOwnProperty('y') ? inPosInput.y : view.y,
}; };
view.visible = true; view.visible = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment