How do I do that? If I only want to print a tile in a tileset for example.
I didn't find this option anywhere.
Printing only a part of an image
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Printing only a part of an image
Last edited by Eldy on Fri Mar 15, 2019 2:21 pm, edited 2 times in total.
Re: Printing only a part of an image
Take a look at [wiki]Quad[/wiki]s
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Printing only a part of an image
Can also use:
Simple example:
Code: Select all
ImageData:paste( source, dx, dy, sx, sy, sw, sh )
Code: Select all
crop = {
x = 300, -- upper-left corner of desired image
y = 150,
w = 150, -- size of final crop image
h = 150,
sourceName = 'CircuitBoard.jpg'
}
crop.sourceImage = love.image.newImageData( crop.sourceName )
crop.imageData = love.image.newImageData( crop.w, crop.h )
crop.imageData:paste( crop.sourceImage, 0, 0, crop.x, crop.y, crop.w, crop.h )
crop.image = gr.newImage( crop.imageData )
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests