Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

roma86

macrumors newbie
Original poster
Oct 29, 2012
2
0
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)
1fpf.png

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

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

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

macrumors newbie
Original poster
Oct 29, 2012
2
0
Hi!
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.
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.
 

misee

macrumors member
Jul 4, 2010
65
0
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 ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.