Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
UIImageGroupCompiler.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 
3 using SiliconStudio.Assets.Compiler;
4 using SiliconStudio.Core.IO;
5 using SiliconStudio.Paradox.UI.Data;
6 
7 namespace SiliconStudio.Paradox.Assets.UIImage
8 {
9  /// <summary>
10  /// Texture asset compiler.
11  /// </summary>
12  internal class UIImageGroupCompiler : ImageGroupCompiler<UIImageGroupAsset, UIImageInfo>
13  {
14  protected override void Compile(AssetCompilerContext context, string urlInStorage, UFile assetAbsolutePath, UIImageGroupAsset asset, AssetCompilerResult result)
15  {
16  base.Compile(context, urlInStorage, assetAbsolutePath, asset, result);
17 
18  if(!result.HasErrors)
19  result.BuildSteps.Add(new UIImageGroupCommand(urlInStorage, new ImageGroupParameters<UIImageGroupAsset>(asset, context.Platform), SpriteToTextureIndex, SeparateAlphaTexture));
20  }
21 
22  internal class UIImageGroupCommand : ImageGroupCommand<UIImageGroupAsset, UIImageInfo, UIImageGroupData, UIImageData>
23  {
24  public UIImageGroupCommand(string url, ImageGroupParameters<UIImageGroupAsset> asset, Dictionary<UIImageInfo, int> imageToTextureIndex, bool separateAlpha)
25  : base(url, asset, imageToTextureIndex, separateAlpha)
26  {
27  }
28 
29  protected override void SetImageSpecificFields(UIImageInfo imageInfo, UIImageData newImage)
30  {
31  base.SetImageSpecificFields(imageInfo, newImage);
32 
33  newImage.Borders = imageInfo.Borders;
34  }
35  }
36  }
37 }
Data type for SiliconStudio.Paradox.UI.UIImage.
Definition: UIData.cs:35
Result of a compilation of assets when using IAssetCompiler.Compile
The context used when compiling an asset in a Package.
bool HasErrors
Gets or sets a value indicating whether this instance has errors.
Definition: Logger.cs:46
Defines a normalized file path. See UPath for details. This class cannot be inherited.
Definition: UFile.cs:13