From a9671d07fd97dd4fe010647c84bc2e6a87d6687c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 6 Jan 2019 22:50:45 -0500 Subject: render: sprite: Revamp rendering process. Add support for tinting and simplify batch rendering. --- doc/api.texi | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/api.texi b/doc/api.texi index b1881bd..fc1f8dd 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -1334,8 +1334,8 @@ stored in textures (@pxref{Textures}) and can be used to draw sprites via the @code{draw-sprite} procedure. @deffn {Procedure} draw-sprite @var{texture} @var{position} @ - [#:origin] [#:scale] [#:rotation] [#:blend-mode alpha] @ - [#:rect] [#:shader] + [#:tint white] [#:origin] [#:scale] [#:rotation] [#:blend-mode alpha] @ + [#:rect] Draw @var{texture} at @var{position}. @@ -1345,14 +1345,14 @@ Optionally, other transformations may be applied to the sprite. transformations are applied relative to @var{origin}, a 2D vector, which defaults to the lower-left corner. +@var{tint} specifies the color to multiply against all the sprite's +pixels. By default white is used, which does no tinting at all. + Alpha blending is used by default but the blending method can be changed by specifying @var{blend-mode}. The area drawn to is as big as the texture, by default. To draw to an arbitrary section of the screen, specify @var{rect}. - -Finally, advanced users may specify @var{shader} to change the way the -sprite is rendered entirely. @end deffn It's not uncommon to need to draw hundreds or thousands of sprites @@ -1411,8 +1411,7 @@ artifacts. @deffn {Procedure} draw-nine-patch @var{texture} @var{rect} @ [#:margin 0] [#:top-margin margin] [#:bottom-margin margin] @ [#:left-margin margin] [#:right-margin margin] @ - [#:origin] [#:scale] [#:rotation] [#:blend-mode alpha] @ - [#:shader] + [#:origin] [#:scale] [#:rotation] [#:blend-mode alpha] Draw a nine patch sprite. A nine patch sprite renders @var{texture} as a @var{width} x @var{height} rectangle whose stretchable areas are -- cgit v1.2.3