Draw Text Rotated?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Draw Text Rotated?
I'm playing with kinetic type, but none of the text-drawing algorithms allow rotated text. Is there a way around this than other making images of A-Z, or doing procedural vectors?
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Draw Text Rotated?
Code: Select all
love.graphics.draw(text, x, y, rotation, scale)
For a starter image font, I just steal the one from one of the many examples (Like sinescroller) and shrink it to 50% (Using Photoshop's nearest neighbor method) and color it to black instead of blue. (I use it for my debug messages in my game since it looks good on any background and sticks out enough to know it's for debugging, not for release.)
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Draw Text Rotated?
I love kinetic type. I'm really interested in seeing what you come up with.
YouTube - HARUHI intro - KineticTypography I love this stuff.
YouTube - HARUHI intro - KineticTypography I love this stuff.
Re: Draw Text Rotated?
So i was dumb; I mean is there a formatted draw (love.graphics.drawf) that can be rotated?
love.graphics.draw() is annoying because it doesn't offer good options for rotating around the center, other than computing it yourself.
love.graphics.draw() is annoying because it doesn't offer good options for rotating around the center, other than computing it yourself.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Draw Text Rotated?
I think LÖVE's drawing commands should have been designed a little differently keeping the text drawing separate from the shape drawing. Like love.graphics.drawText("Hello!", x, y, rotation, angle) and love.graphics.drawImage(image, x, y, ...) to keep them separate from each other. Because it seems to be you can use both draw and drawf for text depending on if you want it rotated and scaled or not. I stumbled onto this accidentally when I gave my text wrong parameters and the wrong draw command, instead of drawing a text box with a fixed width, it drew a rotated, scaled text string. There should have been completely different commands for drawing different things. Because drawf may do text, but draw can also do text which gets confusing.
From the documentation:
Note draw is used for both text strings AND images. Depending on what you pass to it. And then it can also be used for particles! But you can also use draws for sprites of a different kind, or drawf for text. Now that's just confusing.
*sigh* I remember the good old simple days of
LOCATE 10,10
PRINT "HELLO!"
LINE (0,9)-(50,9), 15
From the documentation:
Code: Select all
draw( string, x, y ) Draws text on screen.
draw( string, x, y, angle ) Draws rotated text on screen.
draw( string, x, y, angle, s ) Draws rotated/scaled text on screen.
draw( string, x, y, angle, sx, sy ) Draws rotated/scaled text on screen.
draw( sprite, x, y ) Draws an Image or Animation on screen.
draw( sprite, x, y, angle ) Draws a rotated Image or Animation on screen.
draw( sprite, x, y, angle, s ) Draws a rotated/scaled Image or Animation on screen.
draw( sprite, x, y, angle, sx, sy ) Draws a rotated/scaled Image or Animation on screen.
draw( particlesystem, x, y ) Draws a particle system on screen.
drawf( string, x, y, limit ) Draws formatted text on screen, with word wrap.
drawf( string, x, y, limit, align ) Draws formatted text on screen, with word wrap.
draws( image, x, y, cx, cy, w, h ) Draws a subsprite of an Image.
draws( image, x, y, cx, cy, w, h, angle ) Draws a rotated subsprite of an Image.
draws( image, x, y, cx, cy, w, h, angle, s ) Draws a rotated/scaled subsprite of an Image.
draws( image, x, y, cx, cy, w, h, angle, sx, sy ) Draws a rotated/scaled subsprite of an Image.
draws( image, x, y, cx, cy, w, h, angle, sx, sy, ox, oy )
*sigh* I remember the good old simple days of
LOCATE 10,10
PRINT "HELLO!"
LINE (0,9)-(50,9), 15
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Draw Text Rotated?
I don't know. Is 0.6.0 even out? I haven't seen it yet.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Draw Text Rotated?
No, but if you feel reckless, I suppose you could use the development SVN/Mercurial or whatever they are using at the moment.
Help us help you: attach a .love.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Draw Text Rotated?
Not sure I'm feeling wreckless at the moment, but I will look at the changes coming so far.
-
- Party member
- Posts: 101
- Joined: Mon Aug 11, 2008 5:19 am
Re: Draw Text Rotated?
I've been waiting for rotated + line-wrapped text for quite a while now. I don't see it listed specifically in the 0.6.0 list linked above...
Perhaps you simply mean that draw functions for images and text are disambiguated? That's cool, but the OP and I still want to rotate our formatted text.
Can we get confirmation on the presence / absence of that feature in the next release?
--Mr. Strange
Perhaps you simply mean that draw functions for images and text are disambiguated? That's cool, but the OP and I still want to rotate our formatted text.
Can we get confirmation on the presence / absence of that feature in the next release?
--Mr. Strange
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests