StarlingGraphics / Starling-Extension-Graphics

flash.display.Graphics style extension for the Starling Flash GPU rendering framework
https://github.com/StarlingGraphics/Starling-Extension-Graphics/wiki
MIT License
285 stars 88 forks source link

setting a material to line doesn't work #75

Closed AndreAhmed closed 10 years ago

AndreAhmed commented 10 years ago
 I have the following code, but setting a material to the line like the following doesn't work at all., it makes it unvisible.

        var m_lineCoords:Vector.<Point> = new Vector.<Point>();
        m_lineCoords.push(new Point (186, 198));
        m_lineCoords.push(new Point (307, 198));
        m_lineCoords.push(new Point (398, 308));
        m_lineCoords.push(new Point (627, 283));
        m_lineCoords.push(new Point (729, 335));

        var lineShape:Shape = new Shape();
        lineShape.graphics.lineStyle(5,0xFF0000);
        lineShape.graphics.moveTo(m_lineCoords[0].x,m_lineCoords[0].y);

        lineShape.graphics.lineMaterial(10, new StandardMaterial( new StandardVertexShader() , new TextureVertexColorFragmentShader() ) );

        for(var i:uint = 1; i < m_lineCoords.length ; i++)
        {
            lineShape.graphics.lineTo(m_lineCoords[i].x, m_lineCoords[i].y);
        }
IonSwitz commented 10 years ago

You have no texture attached to the StandardMaterial.