Hi folks,
Moonring is coming along nicely, and I've started doing complex stuff like making bosses 'link' to other creatures you have to kill before you can hurt them.
One of the things I required for this was an 'animating textured line with thickness'. I've horribly abused the drawImage so far, and am literally just angling and stretching an image to the appropriate scale. BUT! Of course, what happens is that at most lengths, the texture is horribly squashed or stretched.
I was trying to think of the easiest, neatest way of drawing a line with a texture that repeats and does not stretch. I can't think of any way apart from doing something with multiple quads, or diving into drawing of a primitive, complete with horrible rotation of uvs. Is this true, or has someone else found a nice, neat way to draw a line using a texture aligned appropriately etc.?
Drawing a textured line
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Drawing a textured line
You can have the texture as its own texture (not part of an atlas), and repeat it by using texture coordinates larger than the texture itself.
When you love.graphics.newQuad() you pass the width and height of the quad in the texture. Pass in values greater than the texture's width or height, and you'll get repetition.
When you love.graphics.newQuad() you pass the width and height of the quad in the texture. Pass in values greater than the texture's width or height, and you'll get repetition.
Re: Drawing a textured line
Thanks! I forgot you can rotate UVs on quads. Wait... I don't need to, do I. I'm being a dumbass... :-)
Who is online
Users browsing this forum: Google [Bot] and 239 guests