Difference between revisions of "Buffer luau"

From GiderosMobile
(wip)
 
(wip)
Line 24: Line 24:
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== Methods ===
 
=== Methods ===
[[assert]] ''error if v nil or false, otherwise returns v''<br/><!--GIDEROSMTD:assert(v,message) error if v nil or false, otherwise returns v-->
+
[[buffer.create]] ''creates a buffer of the requested size with all bytes initialized to 0''<br/><!--GIDEROSMTD:buffer.create(size) creates a buffer of the requested size with all bytes initialized to 0-->
 
[[collectgarbage]] ''opts: stop, restart, collect, count, step, setpause, setstepmul''<br/><!--GIDEROSMTD:collectgarbage(opt,arg) opts: stop, restart, collect, count, step, setpause, setstepmul-->
 
[[collectgarbage]] ''opts: stop, restart, collect, count, step, setpause, setstepmul''<br/><!--GIDEROSMTD:collectgarbage(opt,arg) opts: stop, restart, collect, count, step, setpause, setstepmul-->
 
[[ColorValue]] ''sets a Color the r,g,b,a channel values''<br/><!--GIDEROSMTD:ColorValue(r,g,b,a) sets a Color the r,g,b,a channel values-->
 
[[ColorValue]] ''sets a Color the r,g,b,a channel values''<br/><!--GIDEROSMTD:ColorValue(r,g,b,a) sets a Color the r,g,b,a channel values-->

Revision as of 23:39, 5 February 2025

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform linux.png
Available since: Gideros 2025.1

Description

This is the Luau buffer library implemented in Gideros.

Example

-- creates a buffer initialized to the contents of the string
local str = "Hello Gideros!"
b = buffer.fromstring(str)
print(buffer.len(b))
-- returns the buffer data as a string
print(buffer.tostring(b))

Reference

https://luau.org/library#buffer-library
https://create.roblox.com/docs/reference/engine/libraries/buffer

Methods

buffer.create creates a buffer of the requested size with all bytes initialized to 0
collectgarbage opts: stop, restart, collect, count, step, setpause, setstepmul
ColorValue sets a Color the r,g,b,a channel values
dofile executes as Lua chunk, default stdin, returns value
error terminates protected func, never returns
xpcall pcall function f with new error handler err

Events

Constants