Difference between revisions of "love.data.getPackedSize"

(Created page)
 
m
 
Line 1: Line 1:
{{newin|[[0.11.0]]|110|type=function}}
+
{{newin|[[11.0]]|110|type=function}}
 
Gets the size in bytes that a given format used with [[love.data.pack]] will use.
 
Gets the size in bytes that a given format used with [[love.data.pack]] will use.
  

Latest revision as of 22:36, 1 April 2018

Available since LÖVE 11.0
This function is not supported in earlier versions.

Gets the size in bytes that a given format used with love.data.pack will use.

This function behaves the same as Lua 5.3's string.packsize.

Function

Synopsis

size = love.data.getPackedSize( format )

Arguments

string format
A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.

Returns

number size
The size in bytes that the packed data will use.

Notes

The format string cannot have the variable-length options 's' or 'z'.

See Also

Other Languages