Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        public override void showBall(ball ball, JsAction callback)
        {
            finishItemBase self = this;

            HtmlElement div = getDiv();
            div.appendChild(ball.getDiv());
        }
Example #4
0
        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 + "%";
        }
Example #5
0
        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);
        }
Example #6
0
        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);
            }
        }
Example #7
0
        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 + "%";
            }
        }
Example #8
0
        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);
            }
        }
Example #9
0
        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();
            }
        }
Example #10
0
        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);
        }