gpt4 book ai didi

smalltalk - 如何在Morphic中制作行进的 Ant 边框?

转载 作者:行者123 更新时间:2023-12-02 09:13:40 26 4
gpt4 key购买 nike

我正在寻找 Morphic 中的行进 Ant 边界或线:

Marching Ants sample

Wikipedia describes a possbile algorithm :

The easiest way to achieve this animation is by drawing the selection using a pen pattern that contains diagonal lines. If the selection outline is only one pixel thick, the slices out of the pattern will then look like a dashed line, and the animation can easily be achieved by simply shifting the pattern one pixel sideways and redrawing the outline.

由于可能没有现成的,有人提示我如何创建这样的边框或线条吗?

(行进的 Ant 图案作为 GIF 动画是 licensed under CC by Uli Kusterer )

最佳答案

事实上,Morphic 确实有:

(PolygonMorph
vertices: Rectangle fromUser corners
color: Color transparent
borderWidth: 2
borderColor: Color black)
dashedBorder: {10. 10. Color white. 0. 1};
openInHand

由于这是基于多边形的,因此它不仅可以是矩形,还可以是任何形状。

关于smalltalk - 如何在Morphic中制作行进的 Ant 边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12393970/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com