Difference between revisions of "love.graphics.setBlendMode"

(Added example)
(Making the BlendMode page more findable)
Line 1: Line 1:
 
{{newin|[[0.2.0]]|020|type=function}}
 
{{newin|[[0.2.0]]|020|type=function}}
Sets the blending mode.
+
Sets the [[BlendMode|blending mode]].
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 29: Line 29:
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]
 
* [[love.graphics.getBlendMode]]
 
* [[love.graphics.getBlendMode]]
 +
* [[BlendMode]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Sets the blending mode.}}
 
{{#set:Description=Sets the blending mode.}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.graphics.setBlendMode}}
 
{{i18n|love.graphics.setBlendMode}}

Revision as of 17:40, 3 September 2012

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

Sets the blending mode.

Function

Synopsis

love.graphics.setBlendMode( mode )

Arguments

BlendMode mode
The blend mode to use.

Returns

Nothing.

Example

function love.load()
	love.graphics.setBackgroundColor(54, 172, 248)
end

function love.draw()
	love.graphics.setBlendMode("alpha") --Default blend mode
	love.graphics.setColor(230, 44, 123)
	love.graphics.rectangle("fill", 50, 50, 100, 100)
	
	love.graphics.setColor(12, 100, 230)
	love.graphics.setBlendMode("multiplicative")
	love.graphics.rectangle("fill", 75, 75, 125, 125)
end

See Also

Other Languages