depth¶
- class janim.components.depth.Cmpt_Depth(value: float, order: int | None = None)¶
基类:
Component,Generic深度组件
如果某个对象的深度值更小,那么它在
>和<的判断中也就更小如果两个对象的深度值相同,那么后创建的对象在
>和<的判断中更小
被用于绘制时,也就是说:
深度大的会被深度小的遮盖
深度一样时,先创建的会被后创建的遮盖
例:
d1 = Depth(0) d2 = Depth(2) d3 = Depth(2) print(d1 < d3) # True print(d2 < d3) # False print(d2 > d3) # True
上面这个例子的绘制顺序(从最早被绘制的到最迟被绘制的):
d2、d3、d1
也就是 d3 会盖住 d2;d1 会盖住 d2 和 d3
- copy() Self¶
- become(other: Cmpt_Depth) Self¶
- not_changed(other: Cmpt_Depth) bool¶
- set(value: float, order: int | None = None, *, root_only: bool = False) Self¶
设置物件的深度
- get() float¶
- get_raw() tuple[float, int]¶
返回元组
(depth, order)
- arrange(depth: float | None = None) Self¶
将子物件排序深度