[英]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
do not know if this is what you want, but maybe you can use it for whatever you want to do, hope it helps. 不知道这是否是您想要的,但是也许您可以将其用于任何您想做的事情,希望对您有所帮助。
https://github.com/libgdx/libgdx/wiki/Path-interface-%26-Splines https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/PathTest.java https://github.com/libgdx/libgdx/wiki/Path-interface-%26-Splines https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/ GDX /测试/ PathTest.java
PS:maybe you can look on Beizer curves https://www.google.es/?gws_rd=ssl#q=http://devmag.org.za+/2011/04/05+/bzier-curves-a-tutorial/ PS:也许您可以看一下Beizer曲线https://www.google.es/?gws_rd=ssl#q=http://devmag.org.za+/2011/04/05+/bzier-curves-a-tutorial /
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.