Reputation: 602
I'm implementing an iOS map-based game, using Swift. There are two components to it: a game player, and a game level designer.
In the game player, basically what I have is a UIViewController
, with a game scene represented as a SKScene
in which the game logic and flow are implemented. Because one game level may have a big map, I would like to have a tiny map besides the game scene to show the overview of the big one.
In the game level designer, the user would be able to design his own game map. I'm currently implementing it as a UICollectionView
, in which each of the cell represents a particular grid in the game map. I would also like to show a tiny map besides the main design area, so that the user could know how's the whole map like. I'm thinking about implementing it as a UIView
, which basically shows a scaled version of the collection view, but I'm not sure how.
Anybody has any idea how to go about doing these?
Upvotes: 2
Views: 662
Reputation: 7233
I would suggest you to go with subclassing UIView to create a new view that shows all the grid images scaled and combined together.
If you have the whole image of map it would be easy, if not then either you combine all the images or create as many UIImageView objects as subview to your view and layout them as appropriate.
Upvotes: 1