Exemple #1
0
        public FilePanel()
        {
            AddChild(listboxComponent = new ListBoxUIComponent()
            {
                texture = Game1.instance.UIRect, itemsPerPage = 10, width = 100, heightOfOneItem = 24
            });
            listboxComponent.OnItemSelectionChange += ListboxComponent_OnItemSelectionChange;

            dragging_ghost = new GameObject();
            dragging_ghost.AddChild(new RawTextureRenderer()
            {
                texture = Game1.instance.UIRect
            });
            dragging_ghost.AddChild(new TextRenderer("Drag Test", Color.Black));
            dragging_ghost.transform.Size = new Vector2(100, 24);
        }
Exemple #2
0
 private void ListboxComponent_OnItemSelectionChange(ListBoxUIComponent sender, int index, string item)
 {
     mouseDownPoint  = WMouse.Position;
     mouseDownOffset = Vector2.Zero;
     selectedId      = index;
 }