如何在 Silverlight 中绘制动画线条?

发布于 2024-09-07 19:52:51 字数 482 浏览 1 评论 0原文

好的,我正在使用 Expression Blend 4 并学习 SL,这一切让我不知所措。我正在开发一个简单的项目来制作飞机等待模式的动画。我想以特定的顺序在屏幕上显示内容:

  1. 绘制一个等待点(车站)
  2. 绘制飞机的位置
  3. 为从飞机位置开始并前往车站的箭头设置动画。
  4. 绘制弧形箭头(以动画方式)。

样机:

alt text

我知道如何使用故事板来制作动画,但我找不到一种简单的方法为步骤 3 和 4 绘制线条/箭头。我可以像故事板中的 mo-fo 一样移动形状(因为所有学习资源都向您展示了如何做),但我不知道如何绘制一条线/箭头。一旦我完成了这个基本步骤,我需要弄清楚如何以编程方式完成它,以便我可以根据输入参数将飞机的位置放置在相对于空间站的位置。

有什么资源或想法可以帮助我开始做这件事吗?

Okay, so I'm using Expression Blend 4 and learning SL, and am pretty overwhelmed with it all. I'm working on a simple project to animate an aircraft holding pattern. I want to show things on the screen in a specific order:

  1. Draw a holding point (the station)
  2. Draw the aircraft's position
  3. Animate an arrow starting at the aircraft's position and going to the station.
  4. draw an arcing arrow (in an animated fashion).

Mockup:

alt text

I know enough to use a storyboard to do my animations, but I can't find a way to simply draw my lines/arrows for steps 3 and 4. I can move shapes around like a mo-fo in a storyboard (because that's what all the learning resources show you how to do), but I can't figure out how to just draw a line/arrow. And once I get past that basic step, I need to figure out how to do it programmatically so I can put the aircraft's position in a location relative to the station based on an input parameter.

Any resources or thoughts to help me get started with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妥活 2024-09-14 19:52:51

有一个 PointAnimation 类,您可以使用它来设置箭头的端点,但它只能线性动画,而不是沿着半圆之类的路径。为此,您需要 PointAnimationUsingPath。

不幸的是Silverlight没有PointAnimationUsingPath,我只找到了这个模拟它的项目: Animation Been a Path for银光

There is a PointAnimation class which you can use to set the endpoint of the arrow, but it only animates linearly, not along a path like a half circle. For that you would need PointAnimationUsingPath.

Unfortunately Silverlight has no PointAnimationUsingPath, I only found this project that emulates it: Animation Along a Path for Silverlight

同尘 2024-09-14 19:52:51

@AnthonyWJones,你很清楚他想要的“动画时尚”是什么。话又说回来,我本质上是一名设计师,所以也许这对我来说是很自然的。

快速而简单的方法是以编程方式完成。只需获取一条线的端点并更新 x,y 坐标即可。现在,您可以直接更新坐标(在这种情况下,您将需要一个游戏循环,我确信您有),或者您可以在端点的最终目标坐标处设置一次坐标,然后启动插值的故事板动画这一切都是为了你。请注意,这仅适用于直线。对于曲线,您需要使用一堆线段(或一条路径),并在游戏循环中进行时为其添加坐标。半圆路径很简单(使用圆的公式!)。

现在困难的方法是由设计师来完成这一切。到目前为止,我还没有找到任何有用的对象(如 PointAnimationUsingPath)。如果有人被发现/知道,我真的很想知道如何。

@AnthonyWJones, you know very well what he's wanting by "animated fashion". Then again, im a designer at heart, so maybe that comes naturally to me.

The quick and easy way is to do it programmatically. Simply take your endpoint of a line and update the x,y coordinates. Now you can either update the coordinate directly (in which case you'll need a game-loop which im sure you have), or you can set the coordinates once at the final destination coordinate of the endpoint and subsequently initiating the storyboard animation that interpolates it all for you. Note that this applies just for a straight line. For the curved line you'll need to use a bunch of line segments (or a path) and add coordinates to it as youre progressing along in your game-loop. The semi-circular path is easy (use the formula for a circle!).

Now the hard way is doing this all from a designer's. So far i havent found any useful objects (like PointAnimationUsingPath). If one is discovered/known I would truly like to know how.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文