在绘制An​​dEngine弧形线条 [英] Drawing curved lines in AndEngine

查看:213
本文介绍了在绘制An​​dEngine弧形线条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来AndEngine,非常高兴,这是很容易的和令人兴奋的事。不幸的是我不能画一条曲线在AndEngine。

I am new to AndEngine and very happy that it's very easy and exciting thing to do. Unfortunately I am unable to draw a curved line in AndEngine.

其实我的情况是,我有一个动画精灵说的对象。我想搬到这个对象与给定的onToucing并拖动它的点线。现在的问题是,我无法找到上绘制点的线,因为它不产生角部的方式的任何方法。我想,没有一个边角流畅的线条。

Actually my scenario is that I have an animated sprite say Object. I want to move this object on a Line with the points given onToucing and dragging it. Now the problem is that I can't find any method to draw a line on points in a way that it does not produce corners. I want a smooth line with no corners.

假设我接触的对象,并用方形区域的点拖动它在屏幕上。但我不希望它的角落。我想要的曲线。 previously我用的Andr​​oid quadTo(..)函数来做到这一点这样做。我想要的是在AndEngine但具有相同的功能,以quadto功能完整的备选方案。

Suppose I touch the object and drag it on the screen with the points of a square type region. But I don't want the corners in it. I want curves. Previously I am doing this by using quadTo(..) function of android to do this. All I want is a complete alternative to quadto function in AndEngine but with same functionality.

推荐答案

您必须将曲线许多许多小直线缝合在一起。

You have to stitch together the curved line from many many small straight lines.

移动沿着一条线一个目的是一个非常不同的任务,但。你想看看CubicBezierMoveModifier和QuadraticBezierMoveModifier那些。

Moving an object along a line is a very different task though. You'd want to have a look at CubicBezierMoveModifier and QuadraticBezierMoveModifier for those.

也许你实际上可以用code在那些修饰符来创建你的'平稳'行。

Maybe you can actually use the code in those modifiers to create your 'smooth' line.

这篇关于在绘制An​​dEngine弧形线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆