Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DynamicSpriteFontDataConverter.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core;
4 using SiliconStudio.Core.Serialization.Converters;
6 
7 namespace SiliconStudio.Paradox.Graphics
8 {
9  internal class DynamicSpriteFontDataConverter : DataConverter<DynamicSpriteFontData, SpriteFont>
10  {
11  public override void ConvertFromData(ConverterContext converterContext, DynamicSpriteFontData data, ref SpriteFont obj)
12  {
13  var services = converterContext.Tags.Get(ServiceRegistry.ServiceRegistryKey);
14  var fontSystem = services.GetSafeServiceAs<GameFontSystem>().FontSystem;
15  obj = new DynamicSpriteFont(fontSystem, data);
16  }
17 
18  public override void ConvertToData(ConverterContext converterContext, ref DynamicSpriteFontData data, SpriteFont obj)
19  {
20  throw new System.NotImplementedException();
21  }
22 
23  [ModuleInitializer]
24  public static void Initialize()
25  {
26  ConverterContext.RegisterConverter(new DynamicSpriteFontDataConverter());
27  }
28  }
29 }
The system managing the fonts.
Definition: FontSystem.cs:13
Base class for converters to/from a data type.
SharpDX.DirectWrite.Font Font