class UIng::Area::Draw::Context

Included Modules

Defined in:

uing/area/area/draw/context.cr

Constructors

Instance Method Summary

Macros inherited from module UIng::BlockConstructor

block_constructor block_constructor

Constructor Detail

def self.new(*args, &) #

[View source]
def self.new(*args, **kwargs, &) #

[View source]
def self.new(ref_ptr : Pointer(LibUI::DrawContext)) #

[View source]

Instance Method Detail

def clip(path : Path) : Nil #

Low-level clipping: apply a finished path as clip


[View source]
def clip_path(mode : FillMode = FillMode::Winding, &) #

High-level clipping: build a path in a block, end it, and clip


[View source]
def draw_fill(path : Path, brush : Brush) : Nil #

Low-level: fill an ended path


[View source]
def draw_path(mode : FillMode = FillMode::Winding, fill : Bool = true, stroke : Bool = false, fill_brush : Brush | Nil = nil, stroke_brush : Brush | Nil = nil, stroke_params : StrokeParams | Nil = nil, &) #

High-level: build once, then optionally fill and/or stroke


[View source]
def draw_stroke(path : Path, brush : Brush, stroke_params : StrokeParams) : Nil #

Low-level: stroke an ended path


[View source]
def draw_stroke(path : Path, brush : Brush, cap : UIng::Area::Draw::LineCap = LineCap::Flat, join : UIng::Area::Draw::LineJoin = LineJoin::Miter, thickness : Number = 1.0, miter_limit : Number = 10.0, dash_phase : Number = 0.0, dashes : Enumerable(Float64) | Nil = nil) : Nil #

Convenience overload to build StrokeParams inline


[View source]
def draw_text_layout(text_layout : TextLayout, x : Float64, y : Float64) : Nil #

Text drawing (libui uiDrawText equivalent)


[View source]
def fill_path(brush : Brush, mode : FillMode = FillMode::Winding, &) #

High-level: build a path in a block, end it, and fill


[View source]
def restore : Nil #

[View source]
def save : Nil #

Save/restore helpers


[View source]
def stroke_path(brush : Brush, stroke_params : StrokeParams, mode : FillMode = FillMode::Winding, &) #

High-level: build a path in a block, end it, and stroke


[View source]
def stroke_path(brush : Brush, cap : UIng::Area::Draw::LineCap = LineCap::Flat, join : UIng::Area::Draw::LineJoin = LineJoin::Miter, thickness : Number = 1.0, miter_limit : Number = 10.0, dash_phase : Number = 0.0, dashes : Enumerable(Float64) | Nil = nil, mode : FillMode = FillMode::Winding, &block : Path -> Nil) : Nil #

[View source]
def to_unsafe : Pointer(Void) #

[View source]
def transform(matrix : Matrix) : Nil #

Matrix composition (same semantics as libui's uiDrawTransform)


[View source]