Ejemplo n.º 1
0
        internal override void CopyPropertiesFrom(LW_Element element)
        {
            LW_PaintStyle style = element as LW_PaintStyle;

            if (style != null)
            {
                m_Material    = style.m_Material;
                m_MainTexture = style.m_MainTexture;
                m_PaintMode   = style.m_PaintMode;
                m_UvMode      = style.m_UvMode;
                m_UvTiling    = style.m_UvTiling;
                m_UvOffset    = style.m_UvOffset;
                if (style.m_GradientColors != null)
                {
                    m_GradientColors = new List <LW_ColorStop>(style.m_GradientColors);
                }
                else
                {
                    m_GradientColors = null;
                }
                m_GradientPosition     = style.m_GradientPosition;
                m_GradientRotation     = style.m_GradientRotation;
                m_GradientScale        = style.m_GradientScale;
                m_GradientSpreadMethod = style.m_GradientSpreadMethod;
                m_GradientUnits        = style.m_GradientUnits;
                m_GradientStart        = style.m_GradientStart;
                m_GradientEnd          = style.m_GradientEnd;
                m_Opacity = style.m_Opacity;
            }
            base.CopyPropertiesFrom(element);
        }
Ejemplo n.º 2
0
 public LinearGradientBrush(
     string tag,
     GradientUnits gradientUnits,
     ITransform gradientTransform,
     SpreadMethod spreadMethod,
     Measure x1,
     Measure y1,
     Measure x2,
     Measure y2,
     Stop[] stops)
 {
     Tag               = "LGB:" + tag;
     GradientUnits     = gradientUnits;
     GradientTransform = gradientTransform;
     SpreadMethod      = spreadMethod;
     X1    = x1;
     Y1    = y1;
     X2    = x2;
     Y2    = y2;
     Stops = stops;
 }
Ejemplo n.º 3
0
 internal override void Reset()
 {
     base.Reset();
     m_Material       = null;
     m_MainTexture    = null;
     m_PaintMode      = PaintMode.Solid;
     m_UvMode         = UvMode.Scaled;
     m_UvTiling       = Vector2.one;
     m_UvOffset       = Vector2.zero;
     m_GradientColors = new List <LW_ColorStop>()
     {
         new LW_ColorStop(Color.white, 0f), new LW_ColorStop(Color.black, 1f)
     };
     m_GradientPosition     = Vector3.zero;
     m_GradientRotation     = Vector3.zero;
     m_GradientScale        = Vector3.one;
     m_GradientSpreadMethod = SpreadMethod.pad;
     m_GradientUnits        = GradientUnits.objectBoundingBox;
     m_GradientStart        = new Vector2(0, 0);
     m_GradientEnd          = new Vector2(1, 0);
     m_Opacity = 1;
 }
Ejemplo n.º 4
0
 public RadialGradientBrush(
     string tag,
     GradientUnits gradientUnits,
     ITransform gradientTransform,
     SpreadMethod spreadMethod,
     Measure cx,
     Measure cy,
     Measure r,
     Measure fx,
     Measure fy,
     Stop[] stops)
 {
     Tag               = "LGB:" + tag;
     GradientUnits     = gradientUnits;
     GradientTransform = gradientTransform;
     SpreadMethod      = spreadMethod;
     Stops             = stops;
     Cx = cx;
     Cy = cy;
     Fx = fx;
     Fy = fy;
     R  = r;
 }