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 08-25-2009, 07:51 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 1
Question How to programatically add dynamic text to a UIImage

I'm fairly new using the SDK and want to overlay static and dynamic text over a section of a UIView. I have a "board" that I construct using the full 480x320 size of the screen in landscape mode.

First I rotate the view:
Code:
	[self initWithFrame:CGRectMake(x, y, 480, 320)];
	[self setCenter:CGPointMake(160.0f, 240.0f)];
	[self setTransform:CGAffineTransformMakeRotation(3.141592f / 2.0f)];
then create the scene in a 15x9 loop: x,y
Code:
	NSString* imgKey = [myBoard getCell:x:y];
	UIImage* img=[figures objectForKey:imgKey];
	[img drawAtPoint:CGPointMake(x*cellSize, y*cellSize)];
and this leaves me with a 480x32 strip at the bottom to add my text and nav buttons. The buttons will be centered and they are not at issue here. I.m not sure how to build and then display the text. For example, I'll want the equivalent of a UILabel positioned at 0,288 and another at 0,304 then another set of labels on the other side of the nav buttons at 320,288 and 320,304.

Can I just create a couple of UILabel instances and position them, or is there some better way. Can someone point me to an example that does this, or tell me how to do it?

Thanks!
reststop is offline   Reply With Quote
Reply

Bookmarks

Tags
drawing text, uilabel, uitextview, uiview

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: 266
21 members and 245 guests
ADY, AragornSG, Bertrand21, Dani77, Dattee, Duncan C, fkmtc, HDshot, HemiMG, iDifferent, JasonR, macquitzon216, mer10, prchn4christ, Promo Dispenser, Rudy, sacha1996, sneaky, spiderguy84, Sunny46, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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