struct Tessell::Render::DrawCmd

Defined in:

tessell/render/draw_list.cr

Constructors

Instance Method Summary

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) #

[View source]

Instance Method Detail

def atlas_id : Int32 #

-1 表示无 atlas(纯色/矢量命令)。


[View source]
def bounds : Rect #

[View source]
def clip : Rect | Nil #

[View source]
def color : UInt32 #

RGBA8 打包:0xRRGGBBAA,与 Render::Theme / Kit Theme 一致。 后端负责转 premultiplied 或自身混合格式。


[View source]
def font_size : Float32 #

[View source]
def kind : CmdKind #

[View source]
def p1 : Point #

Line 命令的端点;其他命令保留默认值。


[View source]
def p2 : Point #

[View source]
def radius : Float32 #

[View source]
def stroke_width : Float32 #

[View source]
def text : String #

文本载荷(issue #21):仅 CmdKind::Text 使用。此前文本内容被整体 丢弃,宿主只能另维护平行 batch 边界数组,编译期无法发现错位。 其他命令保持 ""。bounds 目前是 (x, baseline_y, 0, size); font_size 是显式字号字段,后端/golden 以它为准。


[View source]
def texture_id : Int32 #

外部纹理 handle(issue #28):仅 CmdKind::Image 使用,-1 = 未绑定。 与 atlas_id 的 glyph 页号独立命名空间。


[View source]