Exemple #1
0
        private void CycleViewer_Load(object sender, EventArgs e)
        {
            int maxX = 0;
            int maxY = 0;

            foreach (Gondwana.Common.Drawing.Frame frame in _cycle.Sequence)
            {
                if (frame.Size.Width > maxX)
                    maxX = frame.Size.Width;

                if (frame.Size.Height > maxY)
                    maxY = frame.Size.Height;
            }

            this.Size = new Size(maxX, maxY + RectangleToScreen(this.ClientRectangle).Top - this.Top);

            _grid = new Common.Grid.GridPointMatrix(1, 1);
            _grid.CoordinateSystem = new Gondwana.Coordinates.SquareIsoCoordinates();
            _grid.SetGridPointSize(maxX, maxY);

            _grids = new Common.Grid.GridPointMatrixes(_grid);

            _surface = new Rendering.VisibleSurface(this, _grids);

            _sprite = Common.Drawing.Sprites.Sprites.CreateSprite(_grid, _cycle.Sequence.CurrentFrame);
            _sprite.MoveSprite(new PointF(0, 0));
            _sprite.TileAnimator.CurrentCycle = _cycle;
            _sprite.Visible = true;
            _sprite.TileAnimator.StartAnimation();

            Gondwana.Engine.Start();
        }
Exemple #2
0
        private void CycleViewer_Load(object sender, EventArgs e)
        {
            int maxX = 0;
            int maxY = 0;

            foreach (Gondwana.Common.Drawing.Frame frame in _cycle.Sequence)
            {
                if (frame.Size.Width > maxX)
                {
                    maxX = frame.Size.Width;
                }

                if (frame.Size.Height > maxY)
                {
                    maxY = frame.Size.Height;
                }
            }

            this.Size = new Size(maxX, maxY + RectangleToScreen(this.ClientRectangle).Top - this.Top);

            _grid = new Common.Grid.GridPointMatrix(1, 1);
            _grid.CoordinateSystem = new Gondwana.Coordinates.SquareIsoCoordinates();
            _grid.SetGridPointSize(maxX, maxY);

            _grids = new Common.Grid.GridPointMatrixes(_grid);

            _surface = new Rendering.VisibleSurface(this, _grids);

            _sprite = Common.Drawing.Sprites.Sprites.CreateSprite(_grid, _cycle.Sequence.CurrentFrame);
            _sprite.MoveSprite(new PointF(0, 0));
            _sprite.TileAnimator.CurrentCycle = _cycle;
            _sprite.Visible = true;
            _sprite.TileAnimator.StartAnimation();

            Gondwana.Engine.Start();
        }