Esempio n. 1
0
        public override void Construct()
        {
            if (EnableDragAndDrop && CreateDraggableItem != null)
            {
                OnMouseDown = (sender, args) =>
                {
                    var draggedItem = CreateDraggableItem(this);
                    if (draggedItem != null)
                    {
                        DragAndDrop.BeginDrag(Root, draggedItem);
                    }
                }
            }
            ;


            Font = "font10-outline-numsonly";
            TextHorizontalAlign = HorizontalAlign.Center;
            TextVerticalAlign   = VerticalAlign.Bottom;
            TextColor           = new Vector4(1, 1, 1, 1);
            WrapText            = false;

            OnUpdate = (sender, time) =>
            {
                if (Resource != null && Resource.Gui_NewStyle && CachedDynamicSheet == null)
                {
                    CachedDynamicSheet = GetDynamicSheet();
                    Invalidate();
                }
            };

            Root.RegisterForUpdate(this);

            base.Construct();
        }
Esempio n. 2
0
        public override void Construct()
        {
            if (EnableDragAndDrop && CreateDraggableItem != null)
            {
                OnMouseDown = (sender, args) =>
                {
                    var draggedItem = CreateDraggableItem(this);
                    if (draggedItem != null)
                    {
                        DragAndDrop.BeginDrag(Root, draggedItem);
                    }
                }
            }
            ;


            Font = "font10-outline-numsonly";
            TextHorizontalAlign = HorizontalAlign.Center;
            TextVerticalAlign   = VerticalAlign.Bottom;
            TextColor           = new Vector4(1, 1, 1, 1);
            WrapText            = false;

            base.Construct();
        }