Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Checkers View

Checkers View
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 2001
Location: Wisconsin
Status: Offline
Reply With Quote
Jun 21, 2002, 12:18 AM
 
I have been writing a checkers program for for recently. I have the actual game working as a ObjC foundation. I want to put a graphical interface like Apple's Chess in 2D mode. I have no experience with custom views or anything like that. How would I do this?
     
Fresh-Faced Recruit
Join Date: May 2002
Location: Ft Lauderdale
Status: Offline
Reply With Quote
Jun 21, 2002, 06:10 PM
 
Read up on NSView and NSImage. A starting point would be this programming topic: <a href="http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/DrawImages/index.html" target="_blank">Drawing and Images</a>. If you have Aaron H's cocoa book, there is a good section regarding custom views. Create a view and assign it a custom class. In the class you can implement methods such as mouseDown, mouseUp, mouseDragged, etc.

You also need to implement drawRect for the view. Whenever you change something call [self setNeedsDisplay].
     
   
Thread Tools
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -5. The time now is 01:27 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2