Difference between revisions of "SpriteBatch:bind"

m (Edited description)
(Add deprecation note.)
Line 1: Line 1:
 
{{newin|[[0.8.0]]|080|type=function|text=It has been renamed from [[SpriteBatch:lock]]}}
 
{{newin|[[0.8.0]]|080|type=function|text=It has been renamed from [[SpriteBatch:lock]]}}
 +
{{deprecatedin|[[0.9.2]]|092|type=function}}
 +
 
Binds the [[SpriteBatch]] to memory for more efficient updating.
 
Binds the [[SpriteBatch]] to memory for more efficient updating.
  

Revision as of 21:34, 22 February 2015

Available since LÖVE 0.8.0
It has been renamed from SpriteBatch:lock.
Deprecated in LÖVE 0.9.2
This function is deprecated and will be removed in a future version.


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

Other Languages