在SceneKit中使用MapKit [英] Using MapKit in SceneKit
问题描述
这对于专业人士来说必须是一个非常基本的问题.我已经作了一点点谷歌搜索,却找不到我想要的答案.
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.
是否可以在SceneKit中使用MapKit在地图上渲染动画角色?如果不可能的话,在开放世界类型的游戏中该怎么做.我基本上想制作一款以世界地图为背景,可以放大/缩小的游戏.还需要根据用户的位置显示一些游戏选项.
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.
我的didMove()
方法中有以下内容
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)
}
}
推荐答案
您可以在注释视图中渲染场景视图,并在mapview函数"viewFor"中对其进行渲染.
You can render a sceneview in a annotationview, and render it in the mapview function "viewFor".
这篇关于在SceneKit中使用MapKit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!