raylibr 6.0.4
On Linux, installation now checks for the X11 and OpenGL development headers the bundled raylib needs, and if any are missing stops with a message listing them and the packages to install.
SystemRequirementslists the libraries.The webR demos on the website failed with “resolved is not a function” in 6.0.3, because the webR build left out the code that routes raylib’s log through R. They work again.
raygui no longer asks for a huge allocation when a style file has a corrupt (negative) glyph count, which also removes a compiler warning with gcc 16.
raylibr 6.0.3
Changes
The demo assets (textures, fonts, sounds, shaders and the 3D model) are no longer installed with the package, which keeps it under CRAN’s size limit.
raylibr_resource()downloads them on first use into a cache directory (tools::R_user_dir("raylibr", "cache")), or reads them from the directory in theRAYLIBR_ASSETSenvironment variable. Passing a directory, such asraylibr_resource("model"), gives all files in it.Raylib’s log messages now go through R’s console, like
message(), instead of being printed directly to the terminal, and only warnings and errors are shown by default. Useset_trace_log_level(log_level$info)to see all messages.Examples and the guides’ code only open a window in interactive sessions or when the environment variable
RAYLIBR_GLis"true", so R CMD check on a machine without a display no longer tries to. Many more examples of functions that need no window now run.The bundled raylib is rebuilt from the official 6.0 release without the parts raylibr doesn’t use, and is compiled with R’s compiler and flags. All bundled libraries and their authors are now credited in
DESCRIPTIONandinst/COPYRIGHTS.
Bug fixes
gen_image_checked()now requireschecks_xandchecks_yto be positive. Zero crashed R with a floating point exception (integer division by zero) on Intel and AMD processors.Functions that need an open window (drawing,
begin_*()/end_*(), loading textures, shaders, fonts and models, raygui controls, and rlgl) now stop with an error such as “draw_circle()needs an open window” instead of crashing R when no window is open.raygui now uses the font of the current window. It kept the font of the first window opened in a session, whose data is freed when that window closes, so raygui text could disappear, text measurements could return garbage, and R could crash after opening several windows.
gui_scroll_panel()now returnsviewas a rectangle, soview$xworks andviewcan be passed back in on the next frame. It was a plain numeric vector with class"raylibr_rectangle".scrollandvieware now checked like the other arguments.is_color()now returnsTRUEorFALSEfor every input. It raised an error for lists withr,g,banda, returnedNAforNAand unnamed lists, and accepted fractional and out-of-range numbers such as42.5and2^32as packed RGBA values.raylibr’s methods for its struct classes (
$,[[,print(), and so on) now leave objects from other packages alone when they share a class name. For example, printing colorspace colors failed with “Incompatible color provided” while raylibr was loaded.
raylibr 6.0.2
Breaking changes
transform()is nowraylib_transform(), its objects have class"raylib_transform", andis_transform()is nowis_raylib_transform(). The old name maskedbase::transform()every time raylibr was attached, and the shared"transform"class made raylibr’s methods take over the"transform"objects from the scales package, which broke ggplot2 plots that use scale transformations such asscale_x_log10(). The Raylib struct itself is still calledTransform.raylibr_screenshot()andraylibr_screenshot_3d()now default to a 640x480 window (was 400x300).
New features
export_html()turns a raylibr script into a standalone webR page that runs in the browser.New Tetris demo (
demo("tetris", package = "raylibr")), also playable in the browser from the website.
Improvements
raylibr_screenshot()andraylibr_screenshot_3d()capture at full pixel density on HiDPI displays, so images in R Markdown and on the website are sharp. In knitr output they are shown at their logical size, centered and without a caption.The User Guide snippets show only the relevant drawing code, and the Shaders guide has examples of several post-processing shaders.
Bug fixes
load_shader_from_memory()with""for the vertex shader now uses Raylib’s default vertex shader instead of silently falling back to the default shader, andload_shader("", ...)no longer logs a file-open warning.In HiDPI windows, drawing inside
begin_mode_2d()now uses the correct scale.Window flags set by
set_config_flags()(for example byraylibr_screenshot(), which opens a hidden window) no longer carry over to windows opened later in the same session.raygui text no longer disappears in screenshots taken after the first one in a session.
The Images & Textures guide examples rendered as black images because textures were unloaded before the frame was drawn.
