Difference between revisions of "BlendMode"

m (add Source .love)
(Updated for 0.10.0.)
Line 1: Line 1:
 
{{newin|[[0.2.0]]|020|type=enum}}
 
{{newin|[[0.2.0]]|020|type=enum}}
Different ways you do alpha blending. See the [[BlendMode Formulas]] for additional notes.
+
Different ways to do color blending with. See [[BlendAlphaMode]] and the [[BlendMode Formulas]] for additional notes.
 
== Constants ==
 
== Constants ==
 +
;alpha: Alpha blending (normal). The alpha of what's drawn determines its opacity.
 +
{{newin|[[0.9.0]]|090|type=constant}}
 +
;replace: The colors of what's drawn completely replace what was on the screen, with no additional blending.
 +
{{newin|[[0.9.1]]|091|type=constant}}
 +
;screen: 'Screen' blending.
 +
{{newin|[[0.10.0]]|100|type=constants|plural=y}}
 +
;add: The pixel colors of what's drawn are component-wise added to the pixel colors already on the screen.
 +
;subtract: The pixel colors of what's drawn are component-wise subtracted from the pixel colors already on the screen.
 +
;multiply: The pixel colors of what's drawn are component-wise multiplied with the pixel colors already on the screen. The alpha of drawn objects is multiplied with the alpha of the screen rather than determining how much the colors on the screen are affected, even if the "alphamultiply" [[BlendAlphaMode]] is used.
 +
----
 +
{{oldin|[[0.10.0]]|100|type=constants|plural=y}}
 
;additive: Additive blend mode.
 
;additive: Additive blend mode.
;alpha: Alpha blend mode ('normal').
 
 
{{newin|[[0.7.0]]|070|type=constants|plural=y}}
 
{{newin|[[0.7.0]]|070|type=constants|plural=y}}
 
;subtractive: Subtractive blend mode.
 
;subtractive: Subtractive blend mode.
Line 9: Line 19:
 
{{newin|[[0.8.0]]|080|type=constant}}
 
{{newin|[[0.8.0]]|080|type=constant}}
 
;premultiplied: Premultiplied alpha blend mode.
 
;premultiplied: Premultiplied alpha blend mode.
{{newin|[[0.9.0]]|090|type=constant}}
 
;replace: Replace blend mode.
 
{{newin|[[0.9.1]]|091|type=constant}}
 
;screen: Screen blend mode.
 
 
== Example ==
 
== Example ==
 
[[File:blendModes_0.9.2.png|800px|thumb|none]]
 
[[File:blendModes_0.9.2.png|800px|thumb|none]]

Revision as of 19:35, 16 December 2015

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

Different ways to do color blending with. See BlendAlphaMode and the BlendMode Formulas for additional notes.

Constants

alpha
Alpha blending (normal). The alpha of what's drawn determines its opacity.
Available since LÖVE 0.9.0
This constant is not supported in earlier versions.
replace
The colors of what's drawn completely replace what was on the screen, with no additional blending.
Available since LÖVE 0.9.1
This constant is not supported in earlier versions.
screen
'Screen' blending.
Available since LÖVE 0.10.0
These constants are not supported in earlier versions.
add
The pixel colors of what's drawn are component-wise added to the pixel colors already on the screen.
subtract
The pixel colors of what's drawn are component-wise subtracted from the pixel colors already on the screen.
multiply
The pixel colors of what's drawn are component-wise multiplied with the pixel colors already on the screen. The alpha of drawn objects is multiplied with the alpha of the screen rather than determining how much the colors on the screen are affected, even if the "alphamultiply" BlendAlphaMode is used.

Removed in LÖVE 0.10.0
These constants are not supported in that and later versions.
additive
Additive blend mode.
Available since LÖVE 0.7.0
These constants are not supported in earlier versions.
subtractive
Subtractive blend mode.
multiplicative
Multiply blend mode.
Available since LÖVE 0.8.0
This constant is not supported in earlier versions.
premultiplied
Premultiplied alpha blend mode.

Example

blendModes 0.9.2.png

Source .love

See Also

Other Languages