在画布上绘制尖叫泡沫

时间:2014-01-07 10:19:24

标签: android android-canvas

我正在画布上绘制气泡。到目前为止,我已经完成了演讲,广场,思想泡泡。我在画布上绘制尖叫泡沫时遇到困难。 我能够通过反复试验在画布上绘制尖叫气泡,我得到了它的坐标。但是当我增加画布的宽度和高度时,我希望我的泡泡伸展。我能够为其余的泡泡获得此功能,但不能用于尖叫语音泡沫。

有没有人知道怎么做?

以下是我绘制尖叫气泡的代码:( n的值为300) 我知道我传递给drawPath.lineTo()的值有些令人困惑我试图让它反应灵敏。

如果它在阅读时给你们带来困难,我表示歉意。 在此先感谢:)

        drawPath.moveTo(getWidth()-(n+50),getHeight()-100-150);

        drawPath.lineTo(getWidth()-(n),getHeight()-100-145);
        drawPath.lineTo(getWidth()-(n-50),getHeight()-100-190);
        drawPath.lineTo(getWidth()-(n-100),getHeight()-100-160);
        drawPath.lineTo(getWidth()-(n-150),getHeight()-100-190);
        drawPath.lineTo(getWidth()-(n-200),getHeight()-100-145);
        drawPath.lineTo(getWidth()-(n-250),getHeight()-100-150);
        drawPath.lineTo(getWidth()-(n-255),getHeight()-100-100);
        drawPath.lineTo(getWidth()-(n-n),getHeight()-100-80);
        drawPath.lineTo(getWidth()-(n-255),getHeight()-100-70);
        drawPath.lineTo(getWidth()-(n-260),getHeight()-100-10);
        drawPath.lineTo(getWidth()-(n-200),getHeight()-100-15);

        drawPath.lineTo(getWidth()-(n-150),getHeight()-100+25);

        drawPath.lineTo(getWidth()-(n-100),getHeight()-100);

        drawPath.lineTo(getWidth()-(n-50),getHeight()-100+25);

        drawPath.lineTo(getWidth()-(n),getHeight()-100-10);
        drawPath.lineTo(getWidth()-(n+50),getHeight()-100-5);
        drawPath.lineTo(getWidth()-(n+50),getHeight()-100-55);
        drawPath.lineTo(getWidth()-(n+100),getHeight()-100-75);
        drawPath.lineTo(getWidth()-(n+50),getHeight()-100-95);
        drawPath.lineTo(getWidth()-(n+50),getHeight()-100-150);

对于那些不知道尖叫泡沫看起来如何的人,下面是一个例子:

实施例

enter image description here

0 个答案:

没有答案