AS3 中的实体变形鼠标轨迹
我正在尝试复制这种类型的鼠标轨迹。我无法判断它是否使影片剪辑变形或在舞台上绘制单独的对象。我可以以低速复制它,但以高速我不知道他们是如何做到的。
MouseEvent.MOUSE_MOVE 会减慢更新速度,以准确绘制鼠标移动的位置,因此我尝试使用 curveTo 创建曲线,但不幸的是,您仍然遇到了一个锐角点。
I'm trying to duplicate this type of mouse trail. I can't tell if it's deforming a movie clip or drawing separate objects on the stage. I can duplicate it at slow speeds, but at a fast speeds I have no idea how they're doing it.
The MouseEvent.MOUSE_MOVE is way to slow on the update to draw exactly where the mouse is going so I tried using curveTo to create a curve but unfortunately you still hit a point where you get a sharp angle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仔细观察几秒钟,他们可能会每帧将那个小 mc 传输(绘制)到 butmapdata 对象,同时通过使整个位图的 alpha 变小一定比例来调暗位图数据,不确定到底是多少,请对此进行实验。
因此,请使用:
BitmapData.draw 在位图上的某处绘制影片剪辑并
BitmapData.coloTransform 更改整个图像的 alpha 值每帧增加 1% 左右...
所以只需将每个乘数设置为 1.0,直到达到 alpha 并将 alpha 设置为 0.98。只需在每一帧执行颜色变换,随着时间的推移,被位块传输的旧MC的“痕迹”就会消失。
ColorTransform 类
代码片段,其中可能会出现编译错误,只是为了让您了解如何尝试此操作:
如果您遇到困难,请查阅上面提供的 as3 参考链接或网上的一些教程(如果您能找到)。
Looking over it for a few seconds, they are probably blitting(drawing) that small mc to a butmapdata object every frame while at the same time dimming the bitmapdata by making the alpha of the whole bitmap smaller by a perchantage, not sure exatcly how much, please experiment for that.
So, use:
BitmapData.draw to draw the movieclip somewhere on the bitmap and
BitmapData.coloTransform to change the decrase the alpha of the whole image by 1% or so every frame...
so just set every multiplier to 1.0 until you get to alpha and set alpha as say, 0.98. just perform that color transform every frame and over time, the "trail" of the old mc's that were blitted will fade away.
ColorTransform class
code snipet, with compile errors probably, just to give you an idea of how to attempt this:
If you get stuck, consult the as3 reference link supplied above or some tutorial on the net if you can find one.