CRdraw_text: Draws text.

View source: R/CRdraw_text.R

CRdraw_textR Documentation

Draws text.

Description

Draws text to rendering target, upper-left corner of text specified in point_list, using font loaded with CRload_font.

Usage

CRdraw_text( graphics_list, font_list, index, text, point_list, wrap_length = NULL, status = NULL)

Arguments

graphics_list

List containing pointers to window, renderer etc. created with CRopen.

font_list

List of fonts loaded with CRload_font.

index

Index into font_list, specifying which font to use.

text

Character vector specifying text to be drawn.

point_list

List defining upper_left corner of text, containing elements x and y.

wrap_length

After how many pixels should text be wrapped? Wrapping happens at spaces. Leave wrap_length at default (NULL) for single-line, non-wrapped rendering of text.

status

Optional list status with elements value and message to retrieve warnings and error messages.

Examples

    fnt_list <- CRload_font(list(), "C:/Documents/myfont.ttf", 20)
    
    CRset_render_color(gs, list(r = 0, g = 0, b = 0))
    
    CRrender_clear(gs)
    
    CRset_render_color(gs, list(r = 100, g = 0, b = 0))
    
    CRdraw_text(gs, fnt_list, 1, "HELLO!", list(x = 100, y = 100))

    CRrender_present(gs)

lorweiuk/CREx documentation built on March 16, 2024, 3:04 a.m.