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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-23-2008, 01:01 AM   #1 (permalink)
ekbart
New Member
 
Join Date: Aug 2008
Posts: 39
ekbart is on a distinguished road
Question trying to get a view to operate in landscape mode

My whole app is in landscape mode, and I am trying to rotate my view transform so that I can draw with the upper left corner as 0,0. I have it almost working, however there are some fatal flaws and surely someone with better analytic geometry skills than I can straighten me out.

I create a transform and apply it to my view:

Code:
g_landscape_transform = CGAffineTransformMakeRotation(1.57079633);
	g_landscape_transform = CGAffineTransformTranslate (g_landscape_transform, -80.0, +80.0);
	myview = [[LevelView alloc] initWithFrame:applicationFrame viewController:self];
	[myview setTransform:g_landscape_transform];
This transform when applied to the view draws okay. However when I try to respond to touches, the touches don't work on the right side of the screen because when you dump out the values of the the view frame, bounds, and center, you see that the frame is still in portrait mode, along with bounds, and the center is in the old unrotated coordinates.

Well I thought, gee I will just set the bounds and frame to (0, 0, 480, 320), and that should fix things. NOT. after trying to set just bounds, my backgorund shifted over when I drew it, and I can't figure out why setting bounds changes how my stuff is drawn. Surely somebody must know how to set up a view-wide transform that also works with clicks.
ekbart is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,391
Threads: 94,004
Posts: 402,462
Top Poster: BrianSlick (7,978)
Welcome to our newest member, Satnam
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.