Exemplo n.º 1
0
        protected override void Initialize()
        {
            base.Initialize();

            var resMgr          = IoCManager.Resolve <IResourceCache>();
            var handsBoxTexture = resMgr.GetResource <TextureResource>("/Textures/UserInterface/handsbox.png");

            handBox = new StyleBoxTexture()
            {
                Texture = handsBoxTexture,
            };
            handBox.SetPatchMargin(StyleBox.Margin.All, 6);
            inactiveHandBox = new StyleBoxTexture(handBox)
            {
                Modulate = _inactiveColor,
            };
            SetMarginsPreset(LayoutPreset.CenterBottom);
            SetAnchorPreset(LayoutPreset.CenterBottom);

            _handL      = new UIBox2i(0, 0, BOX_SIZE, BOX_SIZE);
            _handR      = _handL.Translated(new Vector2i(BOX_SIZE + BOX_SPACING, 0));
            MouseFilter = MouseFilterMode.Stop;

            LeftSpriteView = new SpriteView {
                MouseFilter = MouseFilterMode.Ignore
            };
            AddChild(LeftSpriteView);
            LeftSpriteView.Size     = _handL.Size;
            LeftSpriteView.Position = _handL.TopLeft;

            RightSpriteView = new SpriteView {
                MouseFilter = MouseFilterMode.Ignore
            };
            AddChild(RightSpriteView);
            RightSpriteView.Size     = _handR.Size;
            RightSpriteView.Position = _handR.TopLeft;
        }
        protected override void Initialize()
        {
            base.Initialize();

            var _resMgr         = IoCManager.Resolve <IResourceCache>();
            var handsBoxTexture = _resMgr.GetResource <TextureResource>("/Textures/UserInterface/handsbox.png");

            handBox = new StyleBoxTexture()
            {
                Texture = handsBoxTexture,
            };
            handBox.SetMargin(StyleBox.Margin.All, 6);
            inactiveHandBox = new StyleBoxTexture(handBox)
            {
                Modulate = _inactiveColor,
            };
            SetMarginsPreset(LayoutPreset.CenterBottom);
            SetAnchorPreset(LayoutPreset.CenterBottom);

            handL = new UIBox2i(0, 0, BOX_SIZE, BOX_SIZE);
            handR = handL.Translated(new Vector2i(BOX_SIZE + BOX_SPACING, 0));
            SS14.Shared.Log.Logger.Debug($"{handL}, {handR}");
            MouseFilter = MouseFilterMode.Stop;
        }