マトリックス関数を使用してシェイプ ブラシを使用して描画するペイント プログラムを作成しています。まったくスムーズではないという事実を除けば、すべてがうまく機能します。マウスを高速で動かすと、絵に隙間ができます。
私はいたるところを見てきましたが、解決策を見つけることができませんでした。
コードは基本的に次のようになります。
//Press mouse within container. Uses Matrix to draw instances of the brush.
private function handleMouseDown_drawContainer(e:MouseEvent):void
{
_matrix.identity();
_matrix.translate(mouseX - 10, mouseY - 30);
_layout.bitmapData.draw(_layout.brush, _matrix);
_layout.drawContainer.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove_drawContainer);
_layout.drawContainer.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp_drawContainer)
}
//Move mouse within container. Uses Matrix to draw instances of the brush.
private function handleMouseMove_drawContainer(e:MouseEvent):void
{
_matrix.identity();
_matrix.translate(mouseX - 10, mouseY - 30);
_layout.bitmapData.draw(_layout.brush, _matrix);
}
誰かが図面を滑らかにする方法を理解するのを手伝ってくれたら、私は永遠に感謝します! =p
前もって感謝します。