示例#1
0
        public GuiInventoryBase(InventoryBase inventory, GuiTextures background, int width, int height)
        {
            Inventory = inventory;

            ContentContainer.Background        = background;
            ContentContainer.BackgroundOverlay = null;

            ContentContainer.Width  = ContentContainer.MinWidth = ContentContainer.MaxWidth = width;
            ContentContainer.Height = ContentContainer.MinHeight = ContentContainer.MaxHeight = height;

            SetFixedSize(width, height);

            ContentContainer.AutoSizeMode = AutoSizeMode.None;

            AddChild(
                TextOverlay = new GuiTextElement(true)
            {
                HasShadow    = true,
                Background   = new Color(Color.Black, 0.35f),
                Enabled      = false,
                FontStyle    = FontStyle.DropShadow,
                TextColor    = TextColor.Yellow,
                ClipToBounds = false,
                Anchor       = Alignment.TopLeft
                               //BackgroundOverlay = new Color(Color.Black, 0.35f),
            });

            AddChild(CursorItemRenderer = new GuiItem()
            {
                IsVisible    = false,
                ClipToBounds = false,
                AutoSizeMode = AutoSizeMode.None,
                Height       = 18,
                Width        = 18,
                Anchor       = Alignment.TopLeft
            });

            Inventory.SlotChanged   += InventoryOnSlotChanged;
            Inventory.CursorChanged += InventoryOnCursorChanged;
        }
示例#2
0
 public GuiTexture2D(GuiTextures guiTexture, TextureRepeatMode repeatMode = TextureRepeatMode.Stretch, Vector2?scale = null) : this()
 {
     TextureResource = guiTexture;
     RepeatMode      = repeatMode;
     Scale           = scale;
 }
示例#3
0
 public GuiImage(GuiTextures texture, TextureRepeatMode mode = TextureRepeatMode.Stretch)
 {
     Background            = texture;
     Background.RepeatMode = mode;
 }