public void moveBall(ball ball, JsAction callback) { finishRightItem self = this; var points = new JsArray<point>(); points.push(new point {x = xMed, y = yMed, inSide = ESlide.center}); for (int x = xMed; x < xMax; x++) { points.push(new point {x = x, y = yMed}); } points.push(new point {x = xMax, y = yMed, inSide = ESlide.right}); HtmlElement div = getDiv(); div.appendChild(ball.getDiv()); _moveBallInternal(ball, points, callback); }
public void moveBall(ball ball, JsAction callback) { startBottomItem self = this; var points = new JsArray<point>(); points.push(new point {x = xMed, y = yMed, inSide = ESlide.center}); for (int y = yMed; y < yMax; ++y) { points.push(new point {x = xMed, y = y}); } points.push(new point {x = xMed, y = yMax, inSide = ESlide.bottom}); points = points.reverse(); HtmlElement div = getDiv(); div.appendChild(ball.getDiv()); _moveBallInternal(ball, points, callback); }
public override void showBall(ball ball, JsAction callback) { finishItemBase self = this; HtmlElement div = getDiv(); div.appendChild(ball.getDiv()); }
public override void showBall(ball ball, JsAction callback) { startItemBase self = this; HtmlElement div = getDiv(); div.appendChild(ball.getDiv()); ball.getDiv().style.left = xMed + "%"; ball.getDiv().style.top = yMed + "%"; }
public void moveBall(ball ball, JsAction callback) { startLeftItem self = this; var points = new JsArray<point>(); points.push(new point {x = xMed, y = yMed, inSide = ESlide.center}); for (int x = xMed - 1; x > xMin; x--) { points.push(new point {x = x, y = yMed}); } points.push(new point {x = xMin, y = yMed, inSide = ESlide.left}); points = points.reverse(); HtmlElement div = getDiv(); div.appendChild(ball.getDiv()); _moveBallInternal(ball, points, callback); }
public void moveBall(ball ball, JsAction callback) { topToRightItem self = this; var points = new JsArray<point>(); points.push(new point {x = xMed, y = yMin, inSide = ESlide.top}); for (int y = yMin + 1; y < yMed; ++y) { points.push(new point {x = xMed, y = y}); } for (int x = xMed; x < xMax; ++x) { points.push(new point {x = x, y = yMed}); } points.push(new point {x = xMax, y = yMed, inSide = ESlide.right}); HtmlElement div = getDiv(); if (ball.getInSide() == ESlide.top) { div.appendChild(ball.getDiv()); points = points.reverse(); _moveBallInternal(ball, points, callback); } else if (ball.getInSide() == ESlide.right) { div.appendChild(ball.getDiv()); _moveBallInternal(ball, points, callback); } else { js.assert(false); } }
public override void showBall(ball ball, JsAction callback) { topToRightItem self = this; HtmlElement div = getDiv(); if (ball.getInSide() == ESlide.top) { div.appendChild(ball.getDiv()); ball.getDiv().style.left = xMed + "%"; ball.getDiv().style.top = yMin + "%"; } else if (ball.getInSide() == ESlide.right) { div.appendChild(ball.getDiv()); ball.getDiv().style.left = xMax + "%"; ball.getDiv().style.top = yMed + "%"; } }
public void moveBall(ball ball, JsAction callback) { topToBottomItem self = this; var points = new JsArray<point>(); points.push(new point {x = xMed, y = yMin, inSide = ESlide.top}); for (int y = yMin + 1; y < yMax; ++y) { points.push(new point {x = xMed, y = y}); } points.push(new point {x = xMed, y = yMax, inSide = ESlide.bottom}); HtmlElement div = getDiv(); if (ball.getInSide() == ESlide.top) { div.appendChild(ball.getDiv()); points = points.reverse(); _moveBallInternal(ball, points, callback); } else if (ball.getInSide() == ESlide.bottom) { div.appendChild(ball.getDiv()); _moveBallInternal(ball, points, callback); } }
public void _moveBallInternal(ball b, JsArray<point> points, JsAction callback) { itemBase self = this; point point = points.pop(); if (point != null) { b.getDiv().style.left = point.x + "%"; b.getDiv().style.top = point.y + "%"; if (point.inSide != ESlide.none) { b.setInSide(point.inSide); } HtmlContext.window.setTimeout(delegate { self._moveBallInternal(b, points, callback); }, 50); } else { callback(); } }
public void moveBall(ball ball, JsAction callback) { finishTopItem self = this; var points = new JsArray<point>(); points.push(new point {x = xMed, y = yMed, inSide = ESlide.center}); for (int y = yMed; y > yMin; --y) { points.push(new point {x = xMed, y = y}); } points.push(new point {x = xMed, y = yMin, inSide = ESlide.top}); HtmlElement div = getDiv(); div.appendChild(ball.getDiv()); _moveBallInternal(ball, points, callback); }