Esempio n. 1
0
    public void Init(WMG_Bezier_Band_Graph graph)
    {
        this.graph = graph;
//		theGraph.setTextureMaterial(areaShadingRects[i], matToUse);
        bandFillSprite = WMG_Util.createSprite(getTexture(bandFillSpriteGO));
        bandLineSprite = WMG_Util.createSprite(getTexture(bandLineSpriteGO));
//		bandFillSprite = WMG_Util.createAlphaSprite(1024);
//		bandLineSprite = WMG_Util.createAlphaSprite(1024);
//		bandBotLineSprite = WMG_Util.createSprite(getTexture(bandBotLineSpriteGO));
        texSize = bandFillSprite.texture.width;
//		texSize = 1024;
        bandFillColors = new Color[texSize * texSize];
        bandLineColors = new Color[texSize * texSize];
//		bandBotLineColors = new Color[texSize * texSize];
        setTexture(bandFillSpriteGO, bandFillSprite);
        setTexture(bandLineSpriteGO, bandLineSprite);
//		setTexture(bandBotLineSpriteGO, bandBotLineSprite);
        size = Mathf.RoundToInt(Mathf.Sqrt(bandFillColors.Length));
//		size = 1024;
        maxS = size - 1;
//		setTextureMaterial(bandFillSpriteGO, graph.uiGradient);
//		setTextureMaterial(bandLineSpriteGO, graph.uiGradient);
//		bandFillMat = getTextureMaterial(bandFillSpriteGO);
//		bandLineMat = getTextureMaterial(bandLineSpriteGO);
    }
Esempio n. 2
0
 void Start()
 {
     extraRingSprite = WMG_Util.createSprite(getTexture(extraRing));
     ringTexSize     = extraRingSprite.texture.width;
     extraRingColors = new Color[ringTexSize * ringTexSize];
     setTexture(extraRing, extraRingSprite);
     rings = new List <WMG_Ring>();
 }
Esempio n. 3
0
 public void initialize(WMG_Ring_Graph graph)
 {
     ringSprite = WMG_Util.createSprite(getTexture(ring));
     bandSprite = WMG_Util.createSprite(getTexture(band));
     setTexture(ring, ringSprite);
     setTexture(band, bandSprite);
     this.graph = graph;
     changeSpriteParent(label, graph.ringLabelsParent);
 }
Esempio n. 4
0
    public void Init()
    {
        if (hasInit)
        {
            return;
        }
        hasInit = true;

        changeObjs.Add(numberRingsC);
        changeObjs.Add(textureC);
        changeObjs.Add(degreesC);
        changeObjs.Add(aRingValC);
        changeObjs.Add(ringColorC);
        changeObjs.Add(bandColorC);
        changeObjs.Add(radiusC);
        changeObjs.Add(labelsC);
        changeObjs.Add(hideRingsC);

        textureChanger = defaultTextureChanger;
        colorChanger   = defaultColorChanger;

        extraRingSprite = WMG_Util.createSprite(getTexture(extraRing));
        ringTexSize     = extraRingSprite.texture.width;
        extraRingColors = new Color[ringTexSize * ringTexSize];
        setTexture(extraRing, extraRingSprite);
        rings          = new List <WMG_Ring>();
        origGraphWidth = ((1 - innerRadiusPercentage) * outerRadius);

        bandColors.SetList(_bandColors);
        bandColors.Changed += bandColorsChanged;

        values.SetList(_values);
        values.Changed += valuesChanged;

        labels.SetList(_labels);
        labels.Changed += labelsChanged;

        hideRings.SetList(_hideRings);
        hideRings.Changed += hideRingsChanged;

        ringIDs.SetList(_ringIDs);
        ringIDs.Changed += ringIDsChanged;

        numberRingsC.OnChange += NumberRingsChanged;
        bandColorC.OnChange   += BandColorChanged;
        ringColorC.OnChange   += RingColorChanged;
        labelsC.OnChange      += LabelsChanged;
        degreesC.OnChange     += DegreesChanged;
        aRingValC.OnChange    += DegreesChangedAring;
        radiusC.OnChange      += RadiusChanged;
        textureC.OnChange     += TextureChanged;
        hideRingsC.OnChange   += HideRingsChanged;

        PauseCallbacks();
    }
Esempio n. 5
0
 public void Init(WMG_Bezier_Band_Graph graph)
 {
     this.graph     = graph;
     texSize        = graph.textureResolution;
     bandFillSprite = WMG_Util.createSprite(texSize, texSize);
     bandLineSprite = WMG_Util.createSprite(texSize, texSize);
     bandFillColors = new Color[texSize * texSize];
     bandLineColors = new Color[texSize * texSize];
     setTexture(bandFillSpriteGO, bandFillSprite);
     setTexture(bandLineSpriteGO, bandLineSprite);
 }
Esempio n. 6
0
 public void initialize(WMG_Ring_Graph graph)
 {
     this.graph = graph;
     texSize    = graph.textureResolution;
     ringSprite = WMG_Util.createSprite(texSize, texSize);
     bandSprite = WMG_Util.createSprite(texSize, texSize);
     setTexture(ring, ringSprite);
     setTexture(band, bandSprite);
     changeSpriteParent(label, graph.ringLabelsParent);
     graph.addRingClickEvent(interactibleObj);
     graph.addRingMouseEnterEvent(interactibleObj);
     ringIndex = graph.rings.Count;
 }
Esempio n. 7
0
 public void initialize(WMG_Ring_Graph graph)
 {
     ringSprite  = WMG_Util.createSprite(getTexture(ring));
     bandSprite  = WMG_Util.createSprite(getTexture(band));
     ringTexSize = ringSprite.texture.width;
     bandTexSize = bandSprite.texture.width;
     ringColors  = new Color[ringTexSize * ringTexSize];
     bandColors  = new Color[bandTexSize * bandTexSize];
     setTexture(ring, ringSprite);
     setTexture(band, bandSprite);
     this.graph = graph;
     changeSpriteParent(label, graph.ringLabelsParent);
 }
Esempio n. 8
0
    void createTextureData()
    {
        GameObject temp = GameObject.Instantiate(nodePrefab) as GameObject;

        pieSprite = WMG_Util.createSprite(getTexture(temp.GetComponent <WMG_Pie_Graph_Slice>().objectToColor));
        Destroy(temp);
        texSize      = pieSprite.texture.width;
        colors       = new Color[texSize * texSize];
        cachedColors = pieSprite.texture.GetPixels();
        // get alphaBorderSize, used to determine maximum doughnut radius
        Color[] tempC = pieSprite.texture.GetPixels(texSize / 2, 0, 1, texSize / 2);
        for (int i = 0; i < tempC.Length; i++)
        {
            if (tempC[i].a != 0)
            {
                alphaBorderSize = i + 5;
                break;
            }
        }
    }
Esempio n. 9
0
    void initDoughnut()
    {
        if (doughnutHasInit)
        {
            return;
        }
        doughnutHasInit = true;
        GameObject temp    = GameObject.Instantiate(nodePrefab) as GameObject;
        Texture2D  origTex = getTexture(temp.GetComponent <WMG_Pie_Graph_Slice>().objectToColor);

        colors     = origTex.GetPixels();
        origColors = origTex.GetPixels();
        pieSprite  = WMG_Util.createSprite(origTex);
        Destroy(temp);
        for (int i = 0; i < slices.Count; i++)
        {
            WMG_Pie_Graph_Slice pieSlice = slices[i].GetComponent <WMG_Pie_Graph_Slice>();
            setTexture(pieSlice.objectToColor, pieSprite);
            setTexture(pieSlice.objectToMask, pieSprite);
        }
    }