Have fun with the alignmentMode parameter in SCNText. There was googling around, and there seems to be a problem with alignmentMode and containerFrame. The alternatives that I found suggest using the border limit function to find the size of the text, and then manually adjust accordingly. Great if I can't get the function to work. When I try to get two vectors, I get an error message:
'SCNVector3' does not convert to 'UnsafeMutablePointer <SCNVector3>
I get this both in geometry and in node. code example below
func setCounterValue(counterValue:Int) { var v1 = SCNVector3(x: 0,y: 0,z: 0) var v2 = SCNVector3(x: 0,y: 0,z: 0) _counterValue = counterValue let newText = SCNText(string: String(format: "%06d", counterValue), extrusionDepth:sDepth) newText.font = UIFont (name: "Arial", size: 3) newText.firstMaterial!.diffuse.contents = UIColor.whiteColor() newText.firstMaterial!.specular.contents = UIColor.whiteColor() newText.getBoundingBoxMin(v1, max: v2) _textNode = SCNNode(geometry: newText) _textNode.getBoundingBoxMin(v1, max: v2) }
Any suggestions that were highly appreciated.
source share