コード例 #1
0
 public FixedLengthRect(float top, float right, float bottom, float left)
 {
     this.top    = top;
     this.right  = right;
     this.bottom = bottom;
     this.left   = left;
 }
コード例 #2
0
 public FixedLengthRect(UIFixedLength top, UIFixedLength right, UIFixedLength bottom, UIFixedLength left)
 {
     this.top    = top;
     this.right  = right;
     this.bottom = bottom;
     this.left   = left;
 }
コード例 #3
0
        public override void Enable()
        {
            borderColorTop          = element.style.BorderColorTop;
            borderColorRight        = element.style.BorderColorRight;
            borderColorBottom       = element.style.BorderColorBottom;
            borderColorLeft         = element.style.BorderColorLeft;
            backgroundColor         = element.style.BackgroundColor;
            backgroundTint          = element.style.BackgroundTint;
            backgroundImage         = element.style.BackgroundImage;
            borderRadiusTopLeft     = element.style.BorderRadiusTopLeft;
            borderRadiusTopRight    = element.style.BorderRadiusTopRight;
            borderRadiusBottomLeft  = element.style.BorderRadiusBottomLeft;
            borderRadiusBottomRight = element.style.BorderRadiusBottomRight;
            cornerBevelTopLeft      = element.style.CornerBevelTopLeft;
            cornerBevelTopRight     = element.style.CornerBevelTopRight;
            cornerBevelBottomRight  = element.style.CornerBevelBottomRight;
            cornerBevelBottomLeft   = element.style.CornerBevelBottomLeft;
            shadowColor             = element.style.ShadowColor;
            materialId = element.style.Material;
            opacity    = element.style.Opacity;

            meshType          = element.style.MeshType;
            meshFillAmount    = element.style.MeshFillAmount;
            meshFillDirection = element.style.MeshFillDirection;
            meshFillOrigin    = element.style.MeshFillOrigin;
        }
コード例 #4
0
 public FixedLengthRect(float value)
 {
     this.top    = value;
     this.right  = value;
     this.bottom = value;
     this.left   = value;
 }
コード例 #5
0
ファイル: BorderRadius.cs プロジェクト: veboys/UIForia
 public BorderRadius(UIFixedLength topLeft, UIFixedLength topRight, UIFixedLength bottomRight, UIFixedLength bottomLeft)
 {
     this.topLeft     = topLeft;
     this.topRight    = topRight;
     this.bottomRight = bottomRight;
     this.bottomLeft  = bottomLeft;
 }
コード例 #6
0
ファイル: BorderRadius.cs プロジェクト: veboys/UIForia
 public BorderRadius(float topLeft, float topRight, float bottomRight, float bottomLeft)
 {
     this.topLeft     = topLeft;
     this.topRight    = topRight;
     this.bottomRight = bottomRight;
     this.bottomLeft  = bottomLeft;
 }
コード例 #7
0
ファイル: BorderRadius.cs プロジェクト: veboys/UIForia
 public BorderRadius(float radius)
 {
     this.topLeft     = radius;
     this.topRight    = radius;
     this.bottomRight = radius;
     this.bottomLeft  = radius;
 }
コード例 #8
0
ファイル: StyleAnimation.cs プロジェクト: veboys/UIForia
        protected static float ResolveFixedHeight(UIElement element, Rect viewport, UIFixedLength height)
        {
            switch (height.unit)
            {
            case UIFixedUnit.Pixel:
                return(height.value);

            case UIFixedUnit.Percent:
                return(element.layoutResult.AllocatedHeight * height.value);

            case UIFixedUnit.ViewportHeight:
                return(viewport.height * height.value);

            case UIFixedUnit.ViewportWidth:
                return(viewport.width * height.value);

            case UIFixedUnit.Em:
                return(element.style.TextFontAsset.faceInfo.PointSize * height.value);

            default:
                return(0);
            }
        }
コード例 #9
0
ファイル: MeasurementUtil.cs プロジェクト: veboys/UIForia
        public static float ResolveFixedSize(float baseSize, float viewWidth, float viewHeight, float emSize, UIFixedLength fixedSize)
        {
            switch (fixedSize.unit)
            {
            case UIFixedUnit.Pixel:
                return(fixedSize.value);

            case UIFixedUnit.Percent:
                return(baseSize * fixedSize.value);

            case UIFixedUnit.ViewportHeight:
                return(viewHeight * fixedSize.value);

            case UIFixedUnit.ViewportWidth:
                return(viewWidth * fixedSize.value);

            case UIFixedUnit.Em:
                return(emSize * fixedSize.value);

            default:
                return(0);
            }
        }
コード例 #10
0
        public override void OnStylePropertyChanged(StructList <StyleProperty> propertyList)
        {
            StyleProperty[] properties = propertyList.array;
            int             count      = propertyList.size;

            base.OnStylePropertyChanged(propertyList);

            for (int i = 0; i < count; i++)
            {
                ref StyleProperty property = ref properties[i];

                switch (property.propertyId)
                {
                case StylePropertyId.MeshFillAmount:
                    meshFillAmount      = property.AsFloat;
                    geometryNeedsUpdate = true;
                    break;

                case StylePropertyId.MeshType:
                    meshType            = property.AsMeshType;
                    geometryNeedsUpdate = true;
                    break;

                case StylePropertyId.MeshFillDirection:
                    meshFillDirection   = property.AsMeshFillDirection;
                    geometryNeedsUpdate = true;
                    break;

                case StylePropertyId.MeshFillOrigin:
                    meshFillOrigin      = property.AsMeshFillOrigin;
                    geometryNeedsUpdate = true;
                    break;

                case StylePropertyId.Material:
                    materialId = property.AsMaterialId;
                    break;

                case StylePropertyId.BackgroundTint:
                    backgroundTint  = property.AsColor;
                    dataNeedsUpdate = true;
                    break;

                case StylePropertyId.BackgroundColor:
                    backgroundColor = property.AsColor;
                    dataNeedsUpdate = true;
                    break;

                case StylePropertyId.BorderColorTop:
                    borderColorTop  = property.AsColor;
                    dataNeedsUpdate = true;
                    break;

                case StylePropertyId.BorderColorRight:
                    borderColorRight = property.AsColor;
                    dataNeedsUpdate  = true;
                    break;

                case StylePropertyId.BorderColorBottom:
                    borderColorBottom = property.AsColor;
                    dataNeedsUpdate   = true;
                    break;

                case StylePropertyId.BorderColorLeft:
                    borderColorLeft = property.AsColor;
                    dataNeedsUpdate = true;
                    break;

                case StylePropertyId.BackgroundImage:
                    backgroundImage = property.AsTexture;
                    dataNeedsUpdate = true;
                    break;

                case StylePropertyId.BorderRadiusBottomLeft:
                    borderRadiusBottomLeft = property.AsUIFixedLength;
                    dataNeedsUpdate        = true;
                    break;

                case StylePropertyId.BorderRadiusBottomRight:
                    borderRadiusBottomRight = property.AsUIFixedLength;
                    dataNeedsUpdate         = true;
                    break;

                case StylePropertyId.BorderRadiusTopLeft:
                    borderRadiusTopLeft = property.AsUIFixedLength;
                    dataNeedsUpdate     = true;
                    break;

                case StylePropertyId.BorderRadiusTopRight:
                    borderRadiusTopRight = property.AsUIFixedLength;
                    dataNeedsUpdate      = true;
                    break;

                case StylePropertyId.Opacity:
                    opacity         = property.AsFloat;
                    dataNeedsUpdate = true;
                    break;

                case StylePropertyId.CornerBevelTopLeft:
                    cornerBevelTopLeft = property.AsUIFixedLength;
                    dataNeedsUpdate    = true;
                    break;

                case StylePropertyId.CornerBevelTopRight:
                    cornerBevelTopRight = property.AsUIFixedLength;
                    dataNeedsUpdate     = true;
                    break;

                case StylePropertyId.CornerBevelBottomRight:
                    cornerBevelBottomRight = property.AsUIFixedLength;
                    dataNeedsUpdate        = true;
                    break;

                case StylePropertyId.CornerBevelBottomLeft:
                    cornerBevelBottomLeft = property.AsUIFixedLength;
                    dataNeedsUpdate       = true;
                    break;

                case StylePropertyId.ShadowColor:
                    shadowColor     = property.AsColor;
                    dataNeedsUpdate = true;
                    break;

                case StylePropertyId.BackgroundFit:
                case StylePropertyId.BackgroundImageScaleX:
                case StylePropertyId.BackgroundImageScaleY:
                case StylePropertyId.BackgroundImageRotation:
                case StylePropertyId.BackgroundImageTileX:
                case StylePropertyId.BackgroundImageTileY:
                case StylePropertyId.BackgroundImageOffsetX:
                case StylePropertyId.BackgroundImageOffsetY:
                case StylePropertyId.ShadowTint:
                case StylePropertyId.ShadowOffsetX:
                case StylePropertyId.ShadowOffsetY:
                case StylePropertyId.ShadowSizeX:
                case StylePropertyId.ShadowSizeY:
                case StylePropertyId.ShadowIntensity:
                    dataNeedsUpdate = true;
                    break;

//                        shadowNeedsUpdate = true;
//                        break;
                }
            }