Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-06-2008, 10:26 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 243
Default Drawing text at an angle.

Does anyone know how to draw text at an angle? It's usually drawn horizontally but I would like to have it be at about 30 degree downwards slant. Thanks.
noobAppDeveloper is offline   Reply With Quote
Old 10-06-2008, 11:30 PM   #2 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 288
Default

You could just use a image...

if the text needs to change I imagine you could just make images for each letter and swap them out.

it would be a PITA but it's possible.
Kenrik is offline   Reply With Quote
Old 10-06-2008, 11:51 PM   #3 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 420
Send a message via AIM to jeff_lamarche Send a message via Yahoo to jeff_lamarche
Default

Quote:
Originally Posted by Kenrik View Post
You could just use a image...

Oh, please, no. There's no need to kluge it with an image.

Simply set the transform property of the label to the angle you need. First, here's a macro for converting from degrees to radians. The function we're going to use in a minute requires radians, but I don't think in radians, so I use this:

Code:
#define degreesToRadian(x) (M_PI * x / 180.0)
Now, just do this:

Code:
myLabel.transform = CGAffineTransformMakeRotation(degreesToRadian(43));
Just change 43 to whatever angle you want. You may need to adjust the x and y location after you do this to make it fit nicely.
__________________
Check out my iPhone Dev Blog
You can send me e-mail at my forum username at mac dot com.
jeff_lamarche is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 246
22 members and 224 guests
@sandris, ADY, beleg_1998, Dani77, diyora, FAED, fredidf, F_Bryant, iDifferent, JamesCahall, JasonR, mer10, Oral B, prchn4christ, smithdale87, Speed, spiderguy84, stekki, tgjorgoski, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,755
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:08 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0