Available since LÖVE 0.9.0
This function is not supported in earlier versions.
Reloads the Image's contents from the ImageData or CompressedData used to create the image.
Image:refresh( )
None.
Nothing.
Available since LÖVE 0.10.0
This variant is not supported in earlier versions.
Image:refresh( x, y, width, height )
number x
number y
number width
number height
Nothing.
function love.load() imagedata = love.image.newImageData("pig.png") image = love.graphics.newImage(imagedata) end function love.draw() love.graphics.draw(image) end function love.keypressed(key) if key == "e" then -- Modify the original ImageData and apply the changes to the Image. imagedata:mapPixel(function(x, y, r, g, b, a) return r/2, g/2, b/2, a/2 end) image:refresh() end end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/(Image):refresh