class
Tessell::Kit::PaintListPainter
- Tessell::Kit::PaintListPainter
- Tessell::Kit::Painter
- Reference
- Object
Overview
PaintListPainter 与 DrawListPainter 的 clip 语义一致(issue #25): push_clip/pop_clip 同时约束形状与文本,命令携带解析后的 clip 矩形。 此前文本/形状完全不看 clip,headless 断言会误报通过。
Defined in:
tessell/kit/painter.crConstructors
Instance Method Summary
- #clip_depth : Int32
- #fill_rect(rect : Rect, color : UInt32) : Nil
- #fill_round_rect(rect : Rect, radius : Float32, color : UInt32) : Nil
-
#image(texture_id : Int32, bounds : Rect, tint : UInt32 = 4294967295_u32, src : Rect | Nil = nil) : Nil
外部纹理四边形(issue #28):texture_id 来自 Backend#create_texture (独立命名空间);tint 默认全白 = 原样;src 缺省 = 整图(后端按 纹理尺寸换算 uv)。
- #line(x1 : Float32, y1 : Float32, x2 : Float32, y2 : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil
- #list : PaintList
- #pop_clip : Nil
- #push_clip(rect : Rect) : Nil
- #reset : Nil
- #stroke_rect(rect : Rect, color : UInt32, width : Float32 = 1.0_f32) : Nil
- #stroke_round_rect(rect : Rect, radius : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil
- #text(x : Float32, baseline_y : Float32, text : String, color : UInt32, size : Float32, font_id : Int32 = 0) : Nil
Instance methods inherited from class Tessell::Kit::Painter
fill_rect(rect : Rect, color : UInt32) : Nil
fill_rect,
fill_round_rect(rect : Rect, radius : Float32, color : UInt32) : Nil
fill_round_rect,
image(texture_id : Int32, bounds : Rect, tint : UInt32 = 4294967295_u32, src : Rect | Nil = nil) : Nil
image,
line(x1 : Float32, y1 : Float32, x2 : Float32, y2 : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil
line,
pop_clip : Nil
pop_clip,
push_clip(rect : Rect) : Nil
push_clip,
stroke_rect(rect : Rect, color : UInt32, width : Float32 = 1.0_f32) : Nil
stroke_rect,
stroke_round_rect(rect : Rect, radius : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil
stroke_round_rect,
text(x : Float32, baseline_y : Float32, text : String, color : UInt32, size : Float32, font_id : Int32 = 0) : Nil
text
Constructor Detail
Instance Method Detail
def image(texture_id : Int32, bounds : Rect, tint : UInt32 = 4294967295_u32, src : Rect | Nil = nil) : Nil
#
Description copied from class Tessell::Kit::Painter
外部纹理四边形(issue #28):texture_id 来自 Backend#create_texture (独立命名空间);tint 默认全白 = 原样;src 缺省 = 整图(后端按 纹理尺寸换算 uv)。
def line(x1 : Float32, y1 : Float32, x2 : Float32, y2 : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil
#
def stroke_round_rect(rect : Rect, radius : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil
#
def text(x : Float32, baseline_y : Float32, text : String, color : UInt32, size : Float32, font_id : Int32 = 0) : Nil
#