struct
Tessell::Render::DrawCmd
- Tessell::Render::DrawCmd
- Struct
- Value
- Object
Defined in:
tessell/render/draw_list.crConstructors
Instance Method Summary
-
#atlas_id : Int32
-1 表示无 atlas(纯色/矢量命令)。
- #bounds : Rect
- #clip : Rect | Nil
-
#color : UInt32
RGBA8 打包:0xRRGGBBAA,与 Render::Theme / Kit Theme 一致。 后端负责转 premultiplied 或自身混合格式。
- #font_size : Float32
- #kind : CmdKind
-
#p1 : Point
Line 命令的端点;其他命令保留默认值。
- #p2 : Point
- #radius : Float32
- #stroke_width : Float32
-
#text : String
文本载荷(issue #21):仅 CmdKind::Text 使用。此前文本内容被整体 丢弃,宿主只能另维护平行 batch 边界数组,编译期无法发现错位。 其他命令保持 ""。bounds 目前是 (x, baseline_y, 0, size); font_size 是显式字号字段,后端/golden 以它为准。
-
#texture_id : Int32
外部纹理 handle(issue #28):仅 CmdKind::Image 使用,-1 = 未绑定。 与 atlas_id 的 glyph 页号独立命名空间。
Constructor Detail
def self.new(kind : CmdKind, bounds : Rect, color : UInt32, atlas_id : Int32 = -1, clip : Rect | Nil = nil, radius : Float32 = 0.0_f32, stroke_width : Float32 = 0.0_f32, p1 : Point = Point.new, p2 : Point = Point.new, text : String = "", font_size : Float32 = 0.0_f32, texture_id : Int32 = -1)
#
Instance Method Detail
def color : UInt32
#
RGBA8 打包:0xRRGGBBAA,与 Render::Theme / Kit Theme 一致。 后端负责转 premultiplied 或自身混合格式。
def text : String
#
文本载荷(issue #21):仅 CmdKind::Text 使用。此前文本内容被整体 丢弃,宿主只能另维护平行 batch 边界数组,编译期无法发现错位。 其他命令保持 ""。bounds 目前是 (x, baseline_y, 0, size); font_size 是显式字号字段,后端/golden 以它为准。
def texture_id : Int32
#
外部纹理 handle(issue #28):仅 CmdKind::Image 使用,-1 = 未绑定。 与 atlas_id 的 glyph 页号独立命名空间。