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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-07-2012, 11:11 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2011
Location: Vancouver Island, Canada
Posts: 22
jemicha is on a distinguished road
Default Easy way to find the center coords?

I want to have some UILabels and UIImages animate, and although I can get the center coords with the following code:

Code:
 NSLog(@"the center point of grid center is %f,%f", myLabel.center.x, myLabel.center.y );
It seems to me there must be an easier way to move an object in storyboard and then see its coords so I can code my animation.

Rather than copy down all my original coords, move all the objects then run the program with a pile of NSLogs and check all the new coords so i can enter them into the animation code, and then move everything back to its original position.

Anyone have a better way?

Last edited by jemicha; 01-07-2012 at 11:14 PM. Reason: added generic object name for clarification
jemicha is offline   Reply With Quote
Old 01-09-2012, 12:03 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2011
Location: Vancouver Island, Canada
Posts: 22
jemicha is on a distinguished road
Default

I realized I was using the wrong type of animation. I have been looking up tutorials that are outdated I guess. So I no longer need to find the center coords of objects.

I found out a cool trick that I thought I would post though to help others trying to figure out exactly how far to move things in their animations. I am sure it is very obvious to most it not all of you, but:

If you select the view object you want to move (e.g a UIImage) Holding down the alt/option key while hovering over other view objects, will tell you the relative x and y distances.
jemicha is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, center, cgpoint, coordinates

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: 397
10 members and 387 guests
Atatator, buggen, guusleijsten, j.b.rajesh@gmail.com, morterbaher, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

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