Beispiel #1
0
        /// <summary>
        /// (Protected) Adds a new <see cref="UITileBoard"/> control on the page.
        /// </summary>
        /// <param name="x">X coordinate</param>
        /// <param name="y">Y coordinate</param>
        /// <param name="width">Width of the frame</param>
        /// <param name="height">Height of the frame</param>
        /// <returns>An UIFrame control</returns>
        protected UITileBoard AddTileBoard(int x, int y, int width, int height)
        {
            UITileBoard control = AddControl <UITileBoard>(x, y, RGBColor.Black, 0);

            control.Size = new Dimension(width, height);
            return(control);
        }
        protected override void OnInitialize(object[] parameters)
        {
            UI.Cursor.Enabled     = false;
            UI.Cursor.Moveable    = true;
            UI.Cursor.BoundingBox = new Area(BOARD_POSITION, BOARD_SIZE);
            UI.Cursor.Tile        = (int)TileID.CursorCrosshair;
            UI.Cursor.VFX         = TileVFX.GlowFast;

            UI.Game.Sprites.Viewport = new Area(BOARD_POSITION, BOARD_SIZE);

            TileBoard = AddTileBoard(BOARD_POSITION.X, BOARD_POSITION.Y, BOARD_SIZE.Width, BOARD_SIZE.Height);

            AddImage(0, BOARD_POSITION.Y + BOARD_SIZE.Height, 48, 1, (int)TileID.Frame + 4, RGBColor.CornflowerBlue);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 5, "ARROW KEYS, GAMEPAD: move character/crosshair", (int)TileID.Font, RGBColor.PaleGoldenrod);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 4, "SPACE, GAMEPAD X,Y,A BUTTONS: aim, then shoot", (int)TileID.Font, RGBColor.PaleGoldenrod);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 3, "ESC, GAMEPAD B BUTTON: main menu", (int)TileID.Font, RGBColor.PaleGoldenrod);

            UI.Game.Sprites.OnSpriteCreation += OnSpriteCreation;

            UpdateWorld();
        }
Beispiel #3
0
        protected override void OnInitialize(object[] parameters)
        {
            UI.Cursor.Enabled     = true;
            UI.Cursor.Position    = BOARD_POSITION;
            UI.Cursor.BoundingBox = new Area(BOARD_POSITION, BOARD_SIZE);
            UI.Cursor.Moveable    = true;
            UI.Cursor.Tile        = (int)TileID.Cursor;
            UI.Cursor.VFX         = TileVFX.None;

            AddLabel(1, 1, "DRAWING BOARD", (int)TileID.Font, RGBColor.PaleGoldenrod);

            AddFrame(
                BOARD_POSITION - Position.One, BOARD_SIZE + Dimension.One * 2,
                (int)TileID.Frame, RGBColor.White);

            TileBoard = AddTileBoard(BOARD_POSITION.X, BOARD_POSITION.Y, BOARD_SIZE.Width, BOARD_SIZE.Height);
            TileBoard.Clear(new UITileBoardTile(1, RGBColor.Blue));

            AddLabel(2, UI.Game.Renderer.TileCount.Height - 5, "Arrow keys, gamepad sticks/DPad: move cursor", (int)TileID.Font, RGBColor.PaleGoldenrod);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 4, "Space, gamepad buttons: paint tile", (int)TileID.Font, RGBColor.PaleGoldenrod);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 3, "F: fullscreen toggle, ESC: back", (int)TileID.Font, RGBColor.PaleGoldenrod);
        }