class Tessell::Render::Canvas

Defined in:

tessell/render/canvas.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

def clear : Nil #

[View source]
def clip_depth : Int32 #

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

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

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

[View source]
def list : DrawList #

[View source]
def polyline(points : Array(Tessell::Point), color : UInt32, width : Float32 = 1.0_f32) : Nil #

折线:展开为逐段 Line 命令(同一 clip 下 atlas_id/clip 相同 → 同批)。 points < 2 时不发任何命令。


[View source]
def pop_clip : Nil #

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

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

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

[View source]