Hololens/Lib/Annotations.cs
//########################################################################################################
/// <summary>
/// Method to call for build a new Text3D
/// </summary>
/// <param name="app"> the current running application that display the scene </param>
/// <param name="text"> text to display </param>
/// <param name="pos"> position x y z in the world scene (not relative to user position). The unit is the meter </param>
/// <returns> UrhoSharp Text3D component </returns>
Method to call for build a new Text3D
Method to call for build a new Text3D
public static Text3D Text(StereoApplication app, string text, Vector3 pos)
        {
            var textNode = app.Scene.CreateChild();
            var textComponent = textNode.CreateComponent<Text3D>();
            textComponent.Node.SetScale(0.1f); 
            textComponent.Node.Position = pos;
            textComponent.HorizontalAlignment = HorizontalAlignment.Center;
            textComponent.VerticalAlignment = VerticalAlignment.Top;
            textComponent.ViewMask = 0x80000000; 
            textComponent.SetFont(CoreAssets.Fonts.AnonymousPro, 26); 
            textComponent.Text = text;
            return textComponent; 
        }
public static Text3D Text ( StereoApplication app , string text , Vector3 pos ) { var textNode = app . Scene . CreateChild ( ) ; var textComponent = textNode . CreateComponent < Text3D > ( ) ; textComponent . Node . SetScale ( 0.1f ) ; textComponent . Node . Position = pos ; textComponent . HorizontalAlignment = HorizontalAlignment . Center ; textComponent . VerticalAlignment = VerticalAlignment . Top ; textComponent . ViewMask = 0x80000000 ; textComponent . SetFont ( CoreAssets . Fonts . AnonymousPro , 26 ) ; textComponent . Text = text ; return textComponent ; }
Method to call for build a new Text3D
Method to call for build a new Text3D
// create a new node in the scene and bind a new component to it // reduce the font size as its too large by default // text alignment //hide from raycasts // set font style // component
UrhoSharp Text3D component
UrhoSharp Text3D component
app
StereoApplication
the current running application that display the scene
the current running application that display the scene
text
string
text to display
text to display
pos
Vector3
position x y z in the world scene (not relative to user position). The unit is the meter
position x y z in the world scene ( not relative to user position ) . The unit is the meter