예제 #1
0
        public ConstructCursor(PlayerInterface menu, WorldCamera worldCamera) : base(menu)
        {
            _worldCamera = worldCamera;

            _previewSprite        = new FSprite(Item.GetItemByID(0).element);
            _previewSprite.shader = FShader.Additive;
        }
예제 #2
0
        public TargetCursor(PlayerInterface menu) : base(menu)
        {
            _sprites    = new FSprite[5];
            _sprites[0] = new FSprite("targetcenter");

            FAtlasElement corner = Futile.atlasManager.GetElementWithName("targetcorner");

            _sprites[1]        = new FSprite(corner);
            _sprites[2]        = new FSprite(corner);
            _sprites[2].scaleX = -1f;
            _sprites[3]        = new FSprite(corner);
            _sprites[3].scaleY = -1f;
            _sprites[4]        = new FSprite(corner);
            _sprites[4].scaleX = -1f;
            _sprites[4].scaleY = -1f;

            for (int index = 0; index < _sprites.Length; index++)
            {
                AddElement(_sprites[index]);
            }

            _targetInspector          = new TargetInspector(menu);
            _targetInspector.position = new Vector2(0f, 32f);

            AddElement(_targetInspector);
        }
예제 #3
0
        public DestructCursor(PlayerInterface menu, WorldCamera worldCamera) : base(menu)
        {
            _worldCamera = worldCamera;

            _progress = 0f;

            _destroyElements = new FAtlasElement[8];

            for (int index = 0; index < _destroyElements.Length; index++)
            {
                _destroyElements[index] = Futile.atlasManager.GetElementWithName("destroy" + index);
            }

            _previewSprite = new FSprite(_destroyElements[0]);
        }
예제 #4
0
        public InventoryMenu(PlayerInterface playerInterface) : base(null, true, 0.2f, 0.1f)
        {
            _playerInterface = playerInterface;

            AddElement(new FadePanel(this));

            _itemSlots = new ItemSlot[player.inventorySize];

            for (int index = 0; index < 8f; index++)
            {
                if (player.inventory[index] != null)
                {
                    _itemSlots[index]          = new ItemSlot(this, player.inventory[index]);
                    _itemSlots[index].position =
                        new Vector2(Mathf.Cos(index / 4f * Mathf.PI), Mathf.Sin(index / 4f * Mathf.PI)) * 40f;

                    AddElement(_itemSlots[index]);
                }
            }

            for (int index = 8; index < _itemSlots.Length; index++)
            {
                if (player.inventory[index] != null)
                {
                    _itemSlots[index]          = new ItemSlot(this, player.inventory[index]);
                    _itemSlots[index].position =
                        leftUp + new Vector2(20f, -20f) + new Vector2((index / 8) - 1, -(index % 8)) * 32f;

                    AddElement(_itemSlots[index]);
                }
            }

            _cursorItemContainer = new ItemContainer();
            _inventoryCursor     = new InventoryCursor(this);
            AddElement(_inventoryCursor);

            _exitButton          = new GeneralButton(this, "X", RequestTerminate, false);
            _exitButton.position = rightUp + new Vector2(-24f, -24f);
            _exitButton.size     = new Vector2(16f, 16f);
            AddElement(_exitButton);
        }
예제 #5
0
            public ItemSelect(PlayerInterface playerInterface) : base()
            {
                this._playerInterface = playerInterface;

                _visualizer = new ItemContainerVisualizer[Length];
                for (int index = 0; index < Length; index++)
                {
                    _visualizer[index] = new ItemContainerVisualizer(this, player.inventory[index]);
                    AddElement(_visualizer[index]);
                }

                _factor            = 0f;
                _sleepTime         = 0f;
                _scrollAmount      = 0f;
                _selectSpriteAngle = 0f;

                _selectedItemLabel             = new FLabel("font", string.Empty);
                _selectedItemLabelShadow       = new FLabel("font", string.Empty);
                _selectedItemLabelShadow.color = Color.black;

                container.AddChild(_selectedItemLabelShadow);
                container.AddChild(_selectedItemLabel);
            }
예제 #6
0
 public WorldCursor(PlayerInterface menu) : base(menu)
 {
 }