• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A couple questions relevant to games
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A couple questions relevant to games


  • Subject: Re: A couple questions relevant to games
  • From: j o a r <email@hidden>
  • Date: Sun, 17 Feb 2008 09:21:37 -0800


On Feb 17, 2008, at 7:44 AM, Aaron MacDonald wrote:

1) Is there some functionality to stack views, such that only one is visible at a time in the outer window? If you look at most games, they're usually presented as a set of screens, such as the tile screen or the map screen, all within a single window. Certain actions within these screens makes the application switch to a new screen. Does cocoa/Interface Builder have something like that built in?


In Cocoa you would typically use a NSTabView (with the actual tabs hidden) for this purpose. Or, alternatively, you would just insert / remove subviews manually from your root view.


2) I intend to have a view that shows a grid of tiles. Its actual dimensions should depend on the dimensions of the grid and the dimensions of the images drawn on it (I assume the tile images are of equal size). I may allow dynamic resizing of the view, but it should be constrained so that the images retain their proportions and there are no extra gaps or "partial tiles." So, if the images are square and the grid is square, the view should always be square. I'm asking because in Interface Builder it seems you define the dimensions of a view directly instead of letting it be defined by user parameters at runtime (in this case, the grid and tile dimensions). Is there a way around this?


In IB you set the default size & position for your views, but you can always change them at runtime.

With regards to your concerns about keeping square proportions, take a look at "-[NSWindow setResizeIncrements:]", or alternatively "- [NSWindow(Delegate) windowWillResize:toSize:]".

j o a r


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: A couple questions relevant to games
      • From: Aaron MacDonald <email@hidden>
References: 
 >A couple questions relevant to games (From: Aaron MacDonald <email@hidden>)

  • Prev by Date: Re: @property problem
  • Next by Date: Re: NSOutlineView, NSTreeController and Sample Code "Source View"
  • Previous by thread: A couple questions relevant to games
  • Next by thread: Re: A couple questions relevant to games
  • Index(es):
    • Date
    • Thread