Exemple #1
0
        protected override void DisplayInternal(ISpriteManager spriteManager, IDataRogueControl control, ISystemContainer systemContainer, List <MapCoordinate> playerFov)
        {
            var display = control as MenuSelectorControl;
            var baseX   = control.Position.Left;
            var y       = control.Position.Top;
            var sprite  = spriteManager.Get(display.Direction == TileDirections.Left ? "selector_left" : "selector_right");

            BLTLayers.Set(BLTLayers.UIElementPieces, display.ActivityIndex);
            BLT.Font("");
            BLT.PutExt(baseX, y, 0, -1, sprite.Tile(display.Direction));
        }
        protected override void DisplayInternal(ISpriteManager spriteManager, IDataRogueControl control, ISystemContainer systemContainer, List <MapCoordinate> playerFov)
        {
            var x    = control.Position.X;
            var y    = control.Position.Y;
            var text = (control as TextFormData).Value.ToString();

            var spriteSheet = spriteManager.Get(control.IsFocused ? "textbox_white_small" : "textbox_grey_small");

            BLTLayers.Set(BLTLayers.Text, control.ActivityIndex);
            BLT.Font("text");

            BLT.Print(x + 4, y, text);

            var textSize = BLT.Measure(new String('@', 30));

            var textBoxSize = textSize.Width + 4;

            if (textBoxSize % TILE_SIZE != 0)
            {
                textBoxSize = (textBoxSize / TILE_SIZE + 1) * TILE_SIZE;
            }

            var numberOfTiles = textBoxSize / TILE_SIZE;

            BLTLayers.Set(BLTLayers.UIElements, control.ActivityIndex);
            BLT.Font("");

            for (int i = 0; i < numberOfTiles; i++)
            {
                TileDirections direction = TileDirections.None;
                if (i != 0)
                {
                    direction |= TileDirections.Left;
                }

                if (i != numberOfTiles - 1)
                {
                    direction |= TileDirections.Right;
                }

                BLT.PutExt(x + TILE_SIZE * i, y - 2, 0, -2, spriteSheet.Tile(direction));
            }
        }