ListenForMouse() public method

Listen for mouse events on the whole image
public ListenForMouse ( UIMouseEvent callback ) : void
callback UIMouseEvent
return void
Beispiel #1
0
        public UIDialog(UIDialogStyle style, bool draggable)
        {
            switch (style)
            {
                case UIDialogStyle.Standard:
                var tx = GetTexture((ulong)FileIDs.UIFileIDs.dialog_backgroundtemplate);
                    Background = new UIImage(tx)
                                    .With9Slice(41, 41, 60, 40);
                    break;

                case UIDialogStyle.StandardTall:
                    Background = new UIImage(GetTexture((ulong)FileIDs.UIFileIDs.dialog_backgroundtemplatetall))
                                    .With9Slice(41, 41, 66, 40);
                    break;
            }

            Background.ID = "Background";

            /** Drag area **/
            if (draggable)
            {
                Background.ListenForMouse(new UIMouseEvent(DragMouseEvents));
            }

            this.Add(Background);
        }
Beispiel #2
0
        public UIDialog(UIDialogStyle style, bool draggable)
        {
            if ((style & UIDialogStyle.Tall) > 0)
            {
                Background = new UIImage(GetTexture((ulong)FileIDs.UIFileIDs.dialog_backgroundtemplatetall))
                             .With9Slice(41, 41, 66, 40);
            }
            else
            {
                var tx = GetTexture((ulong)FileIDs.UIFileIDs.dialog_backgroundtemplate);
                Background = new UIImage(tx)
                             .With9Slice(41, 41, 60, 40);
            }

            Background.ID = "Background";

            /** Drag area **/
            if (draggable)
            {
                Background.ListenForMouse(new UIMouseEvent(DragMouseEvents));
            }

            this.Add(Background);

            if ((style & UIDialogStyle.OK) > 0)
            {
                OKBg     = new UIImage(GetTexture((ulong)FileIDs.UIFileIDs.dialog_dwnrightcorner_wbtn));
                OKButton = new UIButton(GetTexture((ulong)FileIDs.UIFileIDs.dialog_okcheckbtn));
                Add(OKBg);
                Add(OKButton);
            }

            if ((style & UIDialogStyle.Close) > 0)
            {
                CloseBg = new UIImage(GetTexture(((style & UIDialogStyle.Tall) > 0) ?
                                                 ((ulong)FileIDs.UIFileIDs.dialog_closebtnbackgroundtall) :
                                                 ((ulong)FileIDs.UIFileIDs.dialog_closebtnbackground)
                                                 ));
                CloseButton = new UIButton(GetTexture((ulong)FileIDs.UIFileIDs.dialog_closebtn));
                Add(CloseBg);
                Add(CloseButton);
            }
        }
Beispiel #3
0
        public UIDialog(UIDialogStyle style, UIDialogExtras extras, bool draggable)
        {
            if ((style & UIDialogStyle.Tall) > 0)
            {
                Background = new UIImage(GetTexture((ulong)FileIDs.UIFileIDs.dialog_backgroundtemplatetall))
                             .With9Slice(41, 41, 66, 40);
            }
            else
            {
                var tx = GetTexture((ulong)FileIDs.UIFileIDs.dialog_backgroundtemplate);
                Background = new UIImage(tx)
                             .With9Slice(41, 41, 60, 40);
            }

            Background.ID = "Background";

            /** Drag area **/
            if (draggable)
            {
                Background.ListenForMouse(new UIMouseEvent(DragMouseEvents));
            }

            this.Add(Background);

            if ((style & UIDialogStyle.OK) > 0)
            {
                OKBg     = new UIImage(GetTexture((ulong)1670742278146));
                OKButton = new UIButton(GetTexture((ulong)9423158247425));
                Add(OKBg);
                Add(OKButton);
            }

            if ((style & UIDialogStyle.Close) > 0)
            {
                CloseBg = new UIImage(GetTexture(((style & UIDialogStyle.Tall) > 0) ?
                                                 ((ulong)1481763717122L) :
                                                 ((ulong)1477468749826L)
                                                 ));
                CloseButton = new UIButton(GetTexture((ulong)8697308774401L));
                Add(CloseBg);
                Add(CloseButton);
            }
        }