class Tessell::Kit::PaintListPainter

Overview

PaintListPainter 与 DrawListPainter 的 clip 语义一致(issue #25): push_clip/pop_clip 同时约束形状与文本,命令携带解析后的 clip 矩形。 此前文本/形状完全不看 clip,headless 断言会误报通过。

Defined in:

tessell/kit/painter.cr

Constructors

Instance Method Summary

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

def self.new(list : PaintList = PaintList.new) #

[View source]

Instance Method Detail

def clip_depth : Int32 #

[View source]
def fill_rect(rect : Rect, color : UInt32) : Nil #

[View source]
def fill_round_rect(rect : Rect, radius : Float32, color : UInt32) : Nil #

[View source]
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)。


[View source]
def line(x1 : Float32, y1 : Float32, x2 : Float32, y2 : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil #

[View source]
def list : PaintList #

[View source]
def pop_clip : Nil #

[View source]
def push_clip(rect : Rect) : Nil #

[View source]
def reset : Nil #

[View source]
def stroke_rect(rect : Rect, color : UInt32, width : Float32 = 1.0_f32) : Nil #

[View source]
def stroke_round_rect(rect : Rect, radius : Float32, color : UInt32, width : Float32 = 1.0_f32) : Nil #

[View source]
def text(x : Float32, baseline_y : Float32, text : String, color : UInt32, size : Float32, font_id : Int32 = 0) : Nil #

[View source]