SpriteBatch:bind

SpriteBatch:bind

Available since LÖVE 0.8.0
It has been renamed from SpriteBatch:lock.

Removed in LÖVE 0.10.0
It happens automatically since version 0.9.2. Use SpriteBatch:flush if absolutely necessary.


Binds the SpriteBatch to memory for more efficient updating.

Binding a SpriteBatch before updating its content can improve the performance as it doesn't push each update to the graphics card separately. Don't forget to unbind the SpriteBatch or the updates won't show up.

Function

Synopsis

SpriteBatch:bind( )

Arguments

None.

Returns

Nothing.

Examples

Updating a SpriteBatch with binding

function update_spritebatch(spritebatch)
	spritebatch:bind()
 
	for i = 1, 100 do
		add_tile(spritebatch)
	end
 
	spritebatch:unbind()
end

See Also

© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/SpriteBatch:bind

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部