Questions tagged [scntext]

An SCNText object is a geometry that creates its contents from a string of text, rendered in 2D and optionally extruded to create a three-dimensional object.

An SCNText object is a geometry that creates its contents from a string of text, rendered in 2D and optionally extruded to create a three-dimensional object.

You provide text for the geometry using an NSString or NSAttributedString object. In the former case, the properties of the SCNText object determine the style and formatting of the entire body of text. When you create a text geometry from an attributed string, SceneKit styles the text according to the attributes in the string, and the properties of the SCNText object determine the default style for portions of the string that have no style attributes. SceneKit can create text geometry using any font and style supported by the Core Text framework, with the exception of bitmap fonts (such as those that define color emoji characters).

30 questions
10
votes
4 answers

SceneKit - SCNText centering incorrectly

I have tried to make a text string (SCNText) fit inside a box (SCNBox) in the code below. The size of the box looks correct but the text is not in the right center of the box. Any idea or solution? Thanks let geoText = SCNText(string: "Hello",…
Tony
  • 1,551
  • 20
  • 21
9
votes
2 answers

SCNText rendering without curves, not font-like

When I run this SceneKit code: let txt = SCNText(string: "Hello", extrusionDepth: 0.2) let textNode = SCNNode(geometry: txt) scene.rootNode.addChildNode(textNode) I get very angular text: It seems to do this regardless of font and it behaves the…
Larry OBrien
  • 8,484
  • 1
  • 41
  • 75
6
votes
3 answers

Swift Scenekit - Centering SCNText - the getBoundingBoxMin:Max issue

Having fun with the alignmentMode option on SCNText. Been googling around and it looks like there is a problem with alignmentMode and containerFrame. The alternatives I've found suggest using the get bounding box function to find the text size and…
Matthew Baker
  • 2,637
  • 4
  • 24
  • 49
4
votes
2 answers

SCNText - background "speech bubble"

How can I insert a background (e.g. a "speech bubble" or a rectangle) to a SCNtext? Specifically, if I insert "Hello World" as SCNText (and obviously then as a SCNNode in the scene) then how can I add a background for that text only? Would it be a…
user8801127
4
votes
0 answers

SCNText Position when run on iOS 9 and iOS 10 gave different result

I have created a project and tested on iPad real Device (iOS 9.3.5) iPad Pro Simulator (iOS 10.2) The results are different for the SCNText locations, it seems that every SCNText when run on iOS 10.2 are vertically offset at some constant distance…
Anan R
  • 311
  • 4
  • 8
3
votes
2 answers

ARKit - How to contain SCNText within another SCNNode (speech bubble)

I am trying to create a quote generator with simple text within a speech bubble in ARKit. I can show the speech bubble with text, but the text always starts in the middle and overflows outside of the speech bubble. Any help getting it align in the…
JimmyJammed
  • 9,598
  • 19
  • 79
  • 146
3
votes
3 answers

Changing programmatically the text of a 3D TextNode in SceneKit using Swift

So I have placed a 3D Text Node in my SCN scene and I would like to change the value of the Text property later in my application SceneKit Inspector Above is how I change the value of the text from the inspector but is there a way to do it…
Joseph Hajjar
  • 138
  • 2
  • 12
2
votes
0 answers

Align SCNText Along SCNCylinder

I am just starting out with ARKit and trying to make a very simple app where the user selects 2 points shown as SCNSphere, a "line" (SCNCylinder) connects the 2 spheres and some text SCNText will appear to show the distance between the 2 points. The…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
2
votes
0 answers

Missing characters in SCNText (iOS 14)

The following code (iOS, ARKit project) creates a SCNText node and attaches it to the root node of the ARKit scene: let font: UIFont = UIFont.systemFont(ofSize: fontSize, weight: UIFont.Weight.regular) let attributes: [NSAttributedString.Key : Any]?…
lechec
  • 839
  • 1
  • 8
  • 17
2
votes
1 answer

SCNText, containerFrame, wrapping and ARKit

Has anyone managed to get an SCNText string wrapping correctly within a containerFrame in ARKit? I've had a go, but the lines seem to be superimposed on top of each other, rather than being rendered vertically in sequence. If it was a problem with…
Zoë Smith
  • 1,084
  • 1
  • 11
  • 19
2
votes
0 answers

SCNText with background view having color and corner radius

I have a requirement to add some text (for example, count) to the scene kit. The text has some background color and that background must be in circular shape as shown below: The text must be in centre to the background view, even the count is in…
KSR
  • 1,699
  • 15
  • 22
2
votes
1 answer

Changing the value of string on SCNText produces no change

I am reading the gyro and changing the string of a SCNText geometry to the gyro's yaw value. The change occurs inside the gyro handler that is called every 1/30 seconds. The SCNText geometry was created with Interface Builder. I am using this code…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
2 answers

How to change the color of text just on one (front) side SCNText?

I am working with SCNScene where I place the SCNText node, so as a result, I get 3d text on the scene, the problem is that if I change the depth of the text it looks like a block of solid color, so it is hard to see what exactly on the screen, there…
Sirop4ik
  • 4,543
  • 2
  • 54
  • 121
1
vote
1 answer

How to add textview inside a node of sceneVIew in ARkit ios

I am new in AR development and currently working with one video calling based application using AR features so need to add UITextview inside sceneview's node I have tried with following code: let scanInfo = UITextView(frame:CGRect(x: location.x,…
Hetali Adhia
  • 506
  • 3
  • 13
1
vote
0 answers

Prevent SCNText's Pivot Point from moving to its Left Alignment Corner

I need to rotate a SCNText object from the place in the sceneView I initially set it to. When I create the SCNText I adjust its pivot point so that it rotates on it's center. The issue is after I do that it moves it self to its leftAlignment…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
1
2