processing - 在处理过程中,matplotlib中是否有类似于zorder的属性?

标签 processing

我的处理程序中有许多随机放置的圆圈。每一个都是这样启动的:

ellipse(x, y, radius, radius);

我想知道是否可以以某种方式为每个圆指定一个 z-index 值。 z 指数较高的圆圈显示在较低 z 指数的圆圈上方。

最佳答案

我现在无法对此进行测试,但我相信您应该查看 fill() 方法。该函数中的第四个参数指定不透明度(也称为 Alpha 透明度)。它的描述见 Processing.org/learning/color .


编辑:这个thread关于绘图顺序似乎会问与您相同的问题。建议使用图像透明度,但似乎更好的答案是利用 Processing Layar Library 。这里是some examples - 第一个似乎与您的问题相符。

引用Advanced层示例部分:

Dynamically Adding, Removing, or Reordering Layers

It is possible to dynamically add, remove, or reorder layers during a sketch's execution, but great care should be taken when doing so. The list of layers managed by the AppletLayers object can be manipulated by obtaining a ListIterator object. The semantics of how a list can be manipulated via an iterator should be studied carefully by reading the Javadoc for java.util.ListIterator. The reason it is difficult to manipulate a list during sketch execution is because the list of layers is being iterated through in order to render them. The best place to manipulate the list of layers is in the main sketch's draw() method and not in a layer's draw() method or in mouse or keyboard event processing.

关于processing - 在处理过程中,matplotlib中是否有类似于zorder的属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9505312/

相关文章:

android - 如何解决 Java Eclipse 中的 "The hierarchy of the type is inconsistent"错误?

ffmpeg - 处理3、视频库: could not load movie file Ubuntu

audio - 具有处理功能的和弦音频播放

java - 使移动的圆圈点击后消失,正在处理

java - 在 Java 中绘制静态图像的最快方法

java - Graphic.addAnimation 调用 addAnimation

javascript - 如何知道哪些应用程序有监听 OSC/MIDI 端口?

java - 在一张图表上显示四组数据

java - 算术错误:/0

java - Facebook4J friend 专辑照片