예제 #1
0
 /// <summary>
 /// Called when the 3D Engine wishes to update the geometry in this element. This is where we need to cache geometry before draw.
 /// </summary>
 /// <param name="rpi">The <see cref="IRenderPassInfo3D" /> containing parameters for the current render pass.</param>
 public override void UpdateScene(IRenderPassInfo3D rpi)
 {
     if (_font == null)
     {
         _font = new Font3D(_fontFamily, (uint)_fontSize);
     }
 }
예제 #2
0
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            var manager = new Font3D
            {
                //StartChar = StartChar,
                CharWidth  = CharWidth,
                CharHeight = CharHeight,
                //IsSupportLowerCase = IsSupportLowerCase
            };

            dstManager.AddComponentData <Font3D>(entity, manager);

            var buffer = dstManager.AddBuffer <FontChar3DElement>(entity);

            for (int i = 0; i < FontChar3Ds.Length; i++)
            {
                var char3D     = FontChar3Ds[i];
                var charPrefab = char3D.Prefab;
                var charEntity = conversionSystem.GetPrimaryEntity(charPrefab);

                var char3DElement = new FontChar3DElement
                {
                    Prefab = charEntity,
                    Min    = char3D.Min,
                    Max    = char3D.Max,
                    Size   = char3D.Size,
                };
                buffer.Add(char3DElement);
            }
        }
예제 #3
0
        public TextSceneEntity(string text, Color textColor, Vector3 location, TextDisplayMode textDisplayMode = TextDisplayMode.FacingCameraAlways, int fontSize = 8, string fontFamily = "Arial")
        {
            _text            = text;
            _textColor       = textColor;
            _location        = location;
            _textDisplayMode = textDisplayMode;
            _font            = new Font3D(fontFamily, (uint)fontSize);

            // Set requires SeletionId to false to exclude this item from selection, tooltips and also
            // prevent issues with maximum number of selectable meshes
            this.RequiresSelectionId = false;
        }
예제 #4
0
 private void DisposeFont()
 {
     _font.SafeDispose();
     _font = null;
 }
예제 #5
0
 /// <summary>
 /// Releases unmanaged and - optionally - managed resources.
 /// </summary>
 public override void Dispose()
 {
     _font.SafeDispose();
     _font = null;
     base.Dispose();
 }