I would guess its better done though that AGAL thang but.

I was playing about with shifting the UVs other day didnt do rotation.

Make sure the bitmapmaterial has tile set to true.

private function incrementUV(m:Mesh, pos:Point):void
{
    var v:Vector.<Number> = SubGeometry(m.geometry.subGeometries[0]).UVData;
    for (var i:int = 0; i < v.length; i=i+2)
    {
        v[i] += pos.x;
        v[i + 1] += pos.y;
        SubGeometry(m.geometry.subGeometries[0]).updateUVData(v);
    }
}

private function scaleUV(m:Mesh, pos:Point):void
{
    var v:Vector.<Number> = SubGeometry(m.geometry.subGeometries[0]).UVData;
    for (var i:int = 0; i < v.length; i=i+2)
    {
        v[i] += ( pos.x - 1) * 0.5;
        v[i + 1] += (pos.y - 1) * 0.5;

        v[i] /= pos.x
        v[i + 1] /= pos.y;

        SubGeometry(m.geometry.subGeometries[0]).updateUVData(v);
    }
}

eg
incrementUV(plane, new Point(0.01, 0.01));
scaleUV(plane, new Point(0.99, 0.99));


No idea how safe/good.
was just playing about :)

Reply via email to