brlrt / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

Update bitmap property of BitmapMaterial,no effect,if bitmap.transparent==true #149

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I use the thunk version Away3d(revision: 2955)

private function onMove(e:MouseEvent3D):void
{
    if (!_mouseDown) return;
    var mat : WhiteShadingBitmapMaterial = _board.material as WhiteShadingBitmapMaterial; 
    var bmp : BitmapData = mat.bitmap;

    var mtx : Matrix = new Matrix(); 
    mtx.tx = e.uv.u * bmp.width; 
    mtx.ty = (1 - e.uv.v) * bmp.height; 
    bmp.draw(_brush, mtx);

    mat.bitmap = bmp;
}
I make a painting program.And if mat.bitmap is created with 
transparent=true,then the _board is not changed on screen immediately,but 
changed at a random time.
You can modify the main.as this line:
  var small:BitmapData = new BitmapData(size, size, false, 0xffffff);
to see the effect

Original issue reported on code.google.com by yangwei...@gmail.com on 3 Mar 2011 at 8:07

Attachments: