Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 30, 2012, 02:37 AM   #1
roma86
macrumors newbie
 
Join Date: Oct 2012
What the way create dragged image

Hi! I create any simple program and game for iPhone, but new on the mac os programming and cocoa.
I want create editor map. It create plist file with image center coordinates and angles rotation added on the box area;
Conception:
Step 1. add background (it is not editable)

Step 2. Images from table can be added to right area (click or drag). We can add more duplicate this object in the area.

Added onto area objects can be moved within background image. We can get coordinates all images, can rotate it around center.

Finally it's all will be exported into plist file as group image by name and items with coordinates.

My question is: how to implement it. This is a joke. )
My questions are:
What the way create draggable object? Can i use image, or not?
What i should use for area when object will be place? It's can be box view or other type view?
What the way create plist file?


I will be grateful for any tips and tutorials describing part of this task.
roma86 is offline   0 Reply With Quote
Old Oct 31, 2012, 06:11 AM   #2
misee
macrumors member
 
Join Date: Jul 2010
Have you read the Drag and Drop Programming Guide?
Creating property lists is quite simple, you can create them from various foundation objects. Check out the Creating Property Lists Programmatically chapter from the Property List Programming Guide.
misee is offline   0 Reply With Quote
Old Oct 31, 2012, 12:46 PM   #3
roma86
Thread Starter
macrumors newbie
 
Join Date: Oct 2012
Hi!
Quote:
Originally Posted by misee View Post
Thanx. But this is not what I need. THis is drag-an-drop between application or within window. I want drag-and-drag-and-drag)) my object and get it coordinates.
Quote:
Originally Posted by misee View Post
Creating property lists is quite simple, you can create them from various foundation objects. Check out the Creating Property Lists Programmatically chapter from the Property List Programming Guide.
Thanx! this is what i need for creating plist files.
roma86 is offline   0 Reply With Quote
Old Oct 31, 2012, 01:09 PM   #4
misee
macrumors member
 
Join Date: Jul 2010
Quote:
Originally Posted by roma86 View Post
Thanx. But this is not what I need. THis is drag-an-drop between application or within window. I want drag-and-drag-and-drag)) my object and get it coordinates.
So you want to drag an object inside an existing view? In that case, you could override NSViews mouseDragged: method. The event that is passed as argument will contain the position of the mouse in the window which you can then convert to your view like so:
Code:
- (void)mouseDragged:(NSEvent *)theEvent {
    NSPoint pointInView = [self convertPoint:[theEvent locationInWindow] fromView:nil];
    // You can now use pointInView for setting a new location
}
Check out the NSView documentation for more coordinate conversion methods or details about the one I used. Hope I understood what you want to do this time
misee is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
could not create "image", SOS!!! wadfndfn MacBook Pro 3 Dec 24, 2013 09:29 AM
create recovery partition OSX 10.9 - after cloning disk image joecool99 OS X Mavericks (10.9) 11 Oct 18, 2013 05:12 AM
re-install Mac os - create image file meashish OS X 10.8 Mountain Lion 3 Aug 3, 2013 08:21 AM
iPod Touch: Can anyone tell my why I can't create a disk image for my iPod touch? waths4523 Jailbreaks and iOS Hacks 5 Apr 13, 2013 11:40 AM
How to create an ISO image? perabear iMac 7 Jan 22, 2013 08:53 AM

Forum Jump

All times are GMT -5. The time now is 05:18 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC