View source: R/CRset_render_target.R
CRset_render_target | R Documentation |
Changes rendering target from window belonging to graphics_list to some texture created by CRcreate_texture
. Use CRreset_render_target
to set window as rendering target again. See CRcreate_texture
for more info.
CRset_render_target(graphics_list, texture_list, index, status = NULL)
graphics_list |
List containing pointers to window, renderer etc. created with |
texture_list |
List of textures created with |
index |
Index of texture intended to be target in texture_list. |
mytexture <- CRcreate_texture(mygraphics, list(), 300, 300)
CRset_render_target(mygraphics, mytexture, 1 ) # set rendering target as first texture in mytexture
CRdraw_rect(mygraphics, list(x=50, y=50, w=100, h=100))
CRdraw_rect(mygraphics, list(x=20, y=30, w= 80, h= 80))
CRdraw_rect(mygraphics, list(x=10, y=20, w= 30, h= 40))
CRreset_render_target(mygraphics)
CRdraw_texture(mygraphics, mytexture, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.