Drawing an Image FROM and Image

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Drawing an Image FROM and Image

Post by Robin »

And on Ubuntu, there's a PPA. Shame it's not been updated in a while, though. I have it, but can't run TechnoCat's thing, since it doesn't have canvases (and I could probably fix it by renaming every Canvas to Framebuffer, but I'm too lazy for that.)
Help us help you: attach a .love.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Drawing an Image FROM and Image

Post by Taehl »

TechnoCat wrote:
Taehl wrote:Love, unfortunately, doesn't offer a way of drawing ribbons (yet?). I wish it did, though.
Create a blank framebuffer and draw to it without clearing. Every frame decrement the opacity of each pixel. I can't remember if 0.7.2 has the explicit framebuffer clearing or if 0.8.0 does.

EDIT: Indeed it requires LOVE 0.8.0. BEWARE! This example isn't dt based.
That's not a ribbon, that's more akin to a motion-blur filter. Ribbons are a chain of polygons with a texture wrapped or stretched across them. Like this (please forgive my crappy diagram):

Image
Where purple are the control points (in this case, from the blue mouse trail), and red is the polygon wireframe made from it. Ribbons often allow the control points to be moved (to emulate gravity, for example), amongst other features.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Drawing an Image FROM and Image

Post by bartbes »

Robin wrote:Shame it's not been updated in a while, though.
Thanks for reminding me, r910 is built and being published as I'm writing this.
NeoFLoyd
Prole
Posts: 11
Joined: Tue Oct 18, 2011 12:30 am

Re: Drawing an Image FROM and Image

Post by NeoFLoyd »

TechnoCat wrote:
Taehl wrote:Love, unfortunately, doesn't offer a way of drawing ribbons (yet?). I wish it did, though.
Create a blank framebuffer and draw to it without clearing. Every frame decrement the opacity of each pixel. I can't remember if 0.7.2 has the explicit framebuffer clearing or if 0.8.0 does.

EDIT: Indeed it requires LOVE 0.8.0. BEWARE! This example isn't dt based.

Thanks to pk supplying a link, I tried out ribbons.love and it isn't exactly what I need. In fact, it's kind of far from it.
User avatar
pk
Citizen
Posts: 67
Joined: Wed Dec 14, 2011 2:13 am
Location: Texas, United States
Contact:

Re: Drawing an Image FROM and Image

Post by pk »

You're gonna have to post a screen shot or a sketch of what you are going for, because I'm stumped.
ALL CREATURE WILL DIE AND ALL THE THINGS WILL BE BROKEN. THAT'S THE LAW OF SAMURAI.
NeoFLoyd
Prole
Posts: 11
Joined: Tue Oct 18, 2011 12:30 am

Re: Drawing an Image FROM and Image

Post by NeoFLoyd »

pk wrote:You're gonna have to post a screen shot or a sketch of what you are going for, because I'm stumped.
All right.

This is rake.png against the in-game background:
Image

Rake.png is draggable by the mouse. When it is dragged, I want raketrail.png to be drawn behind it, as if you're dragging rake.png through sand.

This is raketrail.png:
Image

It's a 1x75 image a few varying shades of brown, if you can't tell.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 4 guests