summaryrefslogtreecommitdiff
path: root/doc/api.texi
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-04-30 21:13:00 -0400
committerDavid Thompson <dthompson2@worcester.edu>2018-04-30 21:13:00 -0400
commit552f061569f25337a7191c67481c4d8bcb1542ba (patch)
tree686da040e054839a42dfcd58c9b5403fefb473e9 /doc/api.texi
parent0ab1c6f234955eff807c1909a6643b04a433c5ff (diff)
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.
Diffstat (limited to 'doc/api.texi')
-rw-r--r--doc/api.texi4
1 files changed, 4 insertions, 0 deletions
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