love.graphics.newPixelEffect
Available since LÖVE 0.8.0 |
This function is not supported in earlier versions. |
Creates a new PixelEffect object for hardware-accelerated pixel level effects.
A PixelEffect contains at least one function, named effect
, which is the effect itself, but it can contain additional functions.
Contents
Function
Synopsis
pixeleffect = love.graphics.newPixelEffect( code )
Arguments
string code
- The pixel effect code.
Returns
PixelEffect pixeleffect
- A PixelEffect object for use in drawing operations.
Effect Function
Synopsis
vec4 effect( vec4 color, sampler2D texture, vec2 texture_coords, vec2 pixel_coords )
Arguments
vec4 color
- The color of the polygon itself. The same as the last love.graphics.setColor call
sampler2D texture
- The texture currently used by the polygon, if it has one.
vec2 texture_coords
- The current texture coordinates.
vec2 pixel_coords
- The current pixel coordinates.
Returns
vec4 output_color
- The color to set the current pixel to.
- Note: LÖVE defines the types
Image
andTexel
, which can be used instead ofsampler2D
andtexture2D
, respectively.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info