14 Dec 2009, 10:09
Generic-user-small

Lyubomir Vezev (2 posts)

Hi I have a problem. Searched for an answer the whole weekend but couldn’t find anything. I need to make a game with multiplayer mode. The game is poker and I can’t find a way to create my player view which i need to place for example 8 times on the table. Can somebody help?

14 Dec 2009, 11:46
N614592285_2406_pragsmall

Chris Adamson (277 posts)

If you want to use images for these players, use Interface Builder to drag eight instances of UIImageView to the game’s view. Connect each to an IBOutlet to modify them from code, or give each a different tag and look them up that way (like we do with custom table cells in the book). You can change the image property of the UIImageView to change the appearance of the image.

On the other hand, if you wanted to do a custom view for each player, you could create a custom UIView subclass, and do your drawing in drawRect:. In IB, drag 8 instances UIView into the gameplay view, and use the identity inspector to change their class from UIView to your custom subclass. Again, you’ll need to use IBOutlet s or tag numbers so your code can find and manipulate them at runtime.

Another option is to make the whole gameplay view (perhaps the whole screen) a single custom view that you draw yourself.

14 Dec 2009, 14:28
Generic-user-small

Lyubomir Vezev (2 posts)

!0q very much for the fast response. I’ll try your second suggestion and will tell what happened ;)

  You must be logged in to comment