Beispiel #1
0
 private void UpdatePresentation(CoreUIEvent e)
 {
     InitIfRequired();
     for (var index = 0; index < _coreUiPresentationParent.Presentations.Count; index++)
     {
         _coreUiPresentationParent.Presentations[index].UpdateSelf(e);
     }
 }
Beispiel #2
0
 public virtual void UpdateSelf(CoreUIEvent e)
 {
     UpdateTexture();
     UpdateQueue();
     UpdateActive();
     UpdateVertialLimit();
     _mesh.mesh = _element.Mesh;
 }
Beispiel #3
0
        public override bool Update(CoreUIEvent e)
        {
            var focused = base.Update(e);

            HandlePressing(e, focused);
            _prevPressed = Pressed;
            return(focused);
        }
Beispiel #4
0
        public override bool Update(CoreUIEvent e)
        {
            var focus = base.Update(e);

            if (focus)
            {
                HandleEvent(e);
            }
            HandleMouse(e);
            UpdatePointPosition();
            return(focus);
        }
Beispiel #5
0
        public override bool Update(CoreUIEvent e)
        {
            var focus = base.Update(e);

            if (_verticalSlider != null)
            {
                ScrollVerticalValue = 1 - _verticalSlider.Value;
            }
            if (_horizontalSlider != null)
            {
                ScrollHorizontalValue = _horizontalSlider.Value;
            }
            return(focus);
        }
Beispiel #6
0
        public virtual bool Update(CoreUIEvent e)
        {
            var focus = Contains(e.PointerPosition);

            if (focus && e.PointerDown)
            {
                _pressed = true;
            }
            if (e.PointerUp)
            {
                _pressed = false;
            }
            return(focus);
        }
Beispiel #7
0
 private void HandleMouse(CoreUIEvent e)
 {
     if (!Point.Pressed)
     {
         return;
     }
     if (_orientation == CoreUIOrientation.Horizontal)
     {
         Value = Mathf.InverseLerp(X + _borderWidth, X + Width - _borderWidth, e.PointerPosition.x);
     }
     else
     {
         Value = Mathf.InverseLerp(Y - Height + _borderWidth, Y - _borderWidth, e.PointerPosition.y);
     }
 }
Beispiel #8
0
 private void HandlePressing(CoreUIEvent e, bool focused)
 {
     if (_prevPressed && e.PointerUp && focused)
     {
         InvokePressing();
     }
     if (Pressed)
     {
         _coreUIMesh.Texture = _pressedTexture;
     }
     else
     {
         _coreUIMesh.Texture = _unpressedTexture;
     }
 }
Beispiel #9
0
        public override bool Update(CoreUIEvent e)
        {
            if (!Active || !Enabled)
            {
                return(false);
            }
            var focused = base.Update(e);

            if (!focused)
            {
                e.DropPointerData();
            }
            for (var index = 0; index < _elements.Count; index++)
            {
                var element = _elements[index];
                if (!element.Active || !element.Enabled)
                {
                    continue;
                }
                var elementFocus = element.Update(e);
                focused = focused || elementFocus;
            }
            return(focused);
        }
Beispiel #10
0
 private void HandleEvent(CoreUIEvent e)
 {
     Value = Value + e.ScrollDir * _delta;
 }
Beispiel #11
0
 protected virtual bool ElementEnable(CoreUIEvent e)
 {
     return(_coreUIMesh.Rect.Contains(e.PointerPosition));
 }
 public override void UpdateSelf(CoreUIEvent e)
 {
     base.UpdateSelf(e);
     _element.Update(e);
 }
Beispiel #13
0
 public override bool Update(CoreUIEvent e)
 {
     _textMesh.TextGenerator.Update();
     _textMesh.ApplyTextMesh();
     return(base.Update(e));
 }