问题
This must be a very basic question to the pros out there. I have done quiet a bit of googling and cant find the answer I wanted.
Is it possible to use MapKit in SceneKit to render animated characters on the map ? If it is not possible how is it done when it comes to Open World type games. I basically want to make a game that has the world map as background which can be zoomed in/out. Also need to show some game options based on user's location.
All the examples I have seen is using a contained background in which the characters/objects are rendered.
Edit:
I have the following in my didMove()
method
class GameScene: SKScene, CLLocationManagerDelegate, MKMapViewDelegate {
override func didMove(to view: SKView) {
var map : MKMapView! = MKMapView()
map.frame = CGRect(x: 0, y: 0, width: frame.size.width, height: frame.size.height - 50)
self.view?.addSubview(map)
}
}
回答1:
You can render a sceneview in a annotationview, and render it in the mapview function "viewFor".
来源:https://stackoverflow.com/questions/38268273/using-mapkit-in-scenekit