public static SsColorRef[] CreateArray(int num)
 {
     var a = new SsColorRef[num];
     for (int i = 0; i < a.Length; ++i)
         a[i] = new SsColorRef();
     return a;
 }
Example #2
0
 public SsColorRef(SsColorRef r)
 {
     R = r.R;
     G = r.G;
     B = r.B;
     A = r.A;
 }
 public SsColorRef(SsColorRef r)
 {
     R = r.R;
     G = r.G;
     B = r.B;
     A = r.A;
 }
Example #4
0
    public SsColorRef[]                             Colors;             // [0]:left top(or whole color) [1]:right top [2]:left bottom [3]:right bottom

    public SsColorBlendKeyValue(int colorsNum)
    {
        Target    = SsColorBlendTarget.None;
        Operation = SsColorBlendOperation.Mix;
        if (colorsNum > 0)
        {
            Colors = SsColorRef.CreateArray(colorsNum);
        }
    }
Example #5
0
    static public SsColorRef[] CreateArray(int num)
    {
        var a = new SsColorRef[num];

        for (int i = 0; i < a.Length; ++i)
        {
            a[i] = new SsColorRef();
        }
        return(a);
    }
Example #6
0
 _GetColorRef(
     SsColorRef o,
     XmlNode n,
     string path)
 {
     if (path != null)
     {
         n = _SelectSingleNode(n, path);
     }
     o.R = _ToByte(_GetNodeValue(n, "./cur:Red"));
     o.G = _ToByte(_GetNodeValue(n, "./cur:Green"));
     o.B = _ToByte(_GetNodeValue(n, "./cur:Blue"));
     o.A = _ToByte(_GetNodeValue(n, "./cur:Alpha"));
 }
Example #7
0
    GetBlendedColor(SsColorRef src, SsColorBlendOperation op)
    {
        Color c = (Color)src;

        if (op == SsColorBlendOperation.Mul)
        {
            // to decrease vertex color's effect, must come near color value to 1
#if false
            // lerp with C#
            c.r = SsInterpolation.Linear(1f - c.a, c.r, 1f);
            c.g = SsInterpolation.Linear(1f - c.a, c.g, 1f);
            c.b = SsInterpolation.Linear(1f - c.a, c.b, 1f);
            // shader: combine texture * primary, texture
#else
            // lerp with shader
            // shader is like this:
            // combine primary lerp (primary) constant=(1,1,1,1), texture
            // combine previous * texture, texture
#endif
        }
        return(c);
    }
Example #8
0
	public SsInterpolatable GetInterpolated(SsCurveParams curve, float time, SsInterpolatable start, SsInterpolatable end, int startTime, int endTime)
	{
		var v = new SsColorRef();
		return v.Interpolate(curve, time, start, end, startTime, endTime);
	}
Example #9
0
 _GetColorRef(SsColorRef o, XmlNode n)
 {
     _GetColorRef(o, n, null);
 }
Example #10
0
    public SsInterpolatable GetInterpolated(SsCurveParams curve, float time, SsInterpolatable start, SsInterpolatable end, int startTime, int endTime)
    {
        var v = new SsColorRef();

        return(v.Interpolate(curve, time, start, end, startTime, endTime));
    }