简体   繁体   English

如何在libgdx的触摸路径上画一条连续线?

[英]How to Draw a continuous line on touch path in libgdx?

I tried using pixmap , but every time i draw a path and increaase drag speed , it shows space betweeen two pixmap circles. 我尝试使用pixmap,但是每次绘制路径并提高拖动速度时,它都会在两个pixmap圆圈之间显示空间。

I also tried by saving touch points in an array and drawind all the points by shaperenderer but same thing happened. 我还尝试通过将接触点保存在数组中并使用shaperenderer将所有点绘制成drawind的方法,但是发生了同样的事情。

I need to draw a smooth line like in some image editor apps. 我需要像在某些图像编辑器应用程序中画一条平滑的线。

Right now using this method. 现在使用这种方法。

    while (cIter.hasNext()) {
        penpoint = cIter.next();
        shapeRenderer.circle(penpoint.getPosition().x,
                penpoint.getPosition().y, 3);
    }

but it shows like this. 但它显示像这样。 https://s3.amazonaws.com/pushbullet-uploads/ujCRdpmszeu-lp4uLBpI5MftwHBvmk58QP4w4mrzfkJx/Screenshot_2014-12-14-15-23-41.png https://s3.amazonaws.com/pushbullet-uploads/ujCRdpmszeu-lp4uLBpI5MftwHBvmk58QP4w4mrzfkJx/Screenshot_2014-12-14-15-23-41.png

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM