コード例 #1
0
 public override LinearShader ToColorShader()
 {
     const float defaultValue = 0.5f;
     Vector2 defaultCenter = new Vector2(defaultValue, defaultValue);
     LinearShader linearShader = base.ToColorShader();
     RadialShader radialShader = new RadialShader
     {
         Center = string.IsNullOrEmpty(Center) ? defaultCenter  : XmlCommon.DecodeFloatVector2(Center),
         RadiusX = RadiusX == 0 ? defaultValue : RadiusX,
         RadiusY = RadiusY == 0 ? defaultValue : RadiusY,
         Gradient = linearShader.Gradient,
         GradientType = linearShader.GradientType,
         Method = linearShader.Method,
         Name = linearShader.Name
     };
     return radialShader;
 }
コード例 #2
0
 public XmlRadialShader(RadialShader radialShader)
     : base(radialShader)
 {
     Center = XmlCommon.EncodeVector2(radialShader.Center);
     GradientType = radialShader.GradientType;
     RadiusX = radialShader.RadiusX;
     RadiusY = radialShader.RadiusY;
 }