public ConstructCursor(PlayerInterface menu, WorldCamera worldCamera) : base(menu) { _worldCamera = worldCamera; _previewSprite = new FSprite(Item.GetItemByID(0).element); _previewSprite.shader = FShader.Additive; }
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); }
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]); }
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); }
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); }
public WorldCursor(PlayerInterface menu) : base(menu) { }