From 552f061569f25337a7191c67481c4d8bcb1542ba Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 30 Apr 2018 21:13:00 -0400 Subject: render: font: Allow rendering of substrings. * chickadee/render/font.scm (draw-text*, draw-text): Add start and end arguments. * doc/api.texi (Fonts): Document new arguments. --- doc/api.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/api.texi b/doc/api.texi index 82cde8f..8295b38 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -892,6 +892,7 @@ Return @code{#t} if @var{font} is an italicized font. @deffn {Procedure} draw-text @var{font} @var{text} @var{position} [#:origin] [#:scale] [#:rotation] [#:blend-mode] + [#:start 0] [#:end @code{(string-length text)}] Draw the string @var{text} with the first character starting at @var{position} using @var{font}. @@ -900,6 +901,9 @@ Draw the string @var{text} with the first character starting at (draw-text font "Hello, world!" (vec2 128.0 128.0)) @end example +To render a substring of @var{text}, use the @var{start} and @var{end} +arguments. + Refer to @code{draw-sprite} (@pxref{Sprites}) for information about the other arguments. @end deffn -- cgit v1.2.3