View source: R/CRdraw_texture.R
CRdraw_texture | R Documentation |
Copies a texture to rendering target. See CRcreate_texture
for more info on textures. CRdraw_texture
can copy the entire texture or parts of it (specified in argument texture_rect), can fill the entire rendering target or parts of it (argument target_rect), can rotate the texture before copying (argument angle). Rotation happens around the point specified in center_point.
CRdraw_texture(graphics_list, texture_list, index, texture_rect = list(), target_rect = list(), angle = 0, center_point = list(), status = NULL)
graphics_list |
List containing pointers to window, renderer etc. created with |
texture_list |
List containing texture to be rendered. Texture first created with |
index |
Index of texture to be rendered in texture_list. |
texture_rect |
List defining rectangle of texture to be drawn (contains elements x, y, w, h; default: whole texture). |
target_rect |
List defining where on renderer to draw texture (contains elements x, y, w, h; default: whole renderer). |
angle |
Specifies rotation of drawn image, in degrees. |
center_point |
Defines point around which to rotate (contains elements x, y). |
status |
Optional list |
txl <- CRcreate_texture(gs, list(), 100, 100)
CRset_render_target(gs, txl, 1)
CRset_render_color(gs, list(r = 100, g = 0, b = 0))
CRfill_rect(gs, list(x = 25, y = 25, w = 50, h = 50))
CRreset_render_target(gs)
CRset_render_color(gs, list(r = 0, g = 0, b = 0))
CRrender_clear(gs)
CRdraw_texture(gs, txl, 1)
CRrender_present(gs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.