大佬教程收集整理的这篇文章主要介绍了ios – 没有曲线的SCNText渲染,而不是字体,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
let txt = SCntext(String: "Hello",extrusionDepth: 0.2) let textNode = SCNNode(geometry: txt) scene.rootNode.addChildNode(textNodE)
我得到非常有棱角的文字:
无论字体如何,它似乎都是这样做的,它在设备上的行为与模拟器中的行为相同.
这是上下文中的代码:
// create a new scene let scene = SCNScene() // create and add a camera to the scene let cameraNode = SCNNode() cameraNode.camera = SCNCamera() scene.rootNode.addChildNode(cameraNodE) // place the camera cameraNode.position = SCNVector3(x: 10,y: 0,z: 75) // create and add a light to the scene let lightNode = SCNNode() lightNode.light = SCNLight() lightNode.light!.type = SCNLightTypeOmni lightNode.position = SCNVector3(x: 0,y: 10,z: 10) scene.rootNode.addChildNode(lightNodE) // create and add an ambient light to the scene let ambientLightNode = SCNNode() ambientLightNode.light = SCNLight() ambientLightNode.light!.type = SCNLightTypeAmbient ambientLightNode.light!.color = UIColor.darkGrayColor() scene.rootNode.addChildNode(ambientLightNodE) let txt = SCntext(String: "Hello",extrusionDepth: 0.2) let textNode = SCNNode(geometry: txt) scene.rootNode.addChildNode(textNodE) // retrieve the SCNView let scnView = self.view as! SCNView // set the scene to the view scnView.scene = scene
以上是大佬教程为你收集整理的ios – 没有曲线的SCNText渲染,而不是字体全部内容,希望文章能够帮你解决ios – 没有曲线的SCNText渲染,而不是字体所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。