The textSize
property is only available on macOS 10.8+
which is why you can't see it (assuming of course you are building for IOS). By this, I mean that if you are building a MacOS app then the variable is accessible. Whereas if you are building for IOS it is not.
If you want to get the size of your SCNText
you can use it's boundingBox
property to get its width and height for example e.g:
//1. Get The Bounding Box Of The Text Node
let boundingBox = textNode.boundingBox
//2. Get The Width & Height Of Our Node
let width = boundingBox.max.x - boundingBox.min.x
let height = boundingBox.max.y - boundingBox.min.y
If you just want to set the fontSize you can do something like so:
//1. Create An SCNNode With An SCNText Geometry
let textNode = SCNNode()
let textGeometry = SCNText(string: "StackOverflow", extrusionDepth: 1)
textGeometry.font = UIFont(name: "Skia-Regular_Black", size: 20)
Remembering of course that when you specify the font size in ARKit
, this in meters.
Hope it helps...