Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SpriteInfo.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 System.ComponentModel;
4 
5 using SiliconStudio.Core;
6 using SiliconStudio.Core.Mathematics;
7 
8 namespace SiliconStudio.Paradox.Assets.Sprite
9 {
10  /// <summary>
11  /// Describes a sprite asset.
12  /// </summary>
13  [DataContract("SpriteInfo")]
14  public class SpriteInfo : ImageInfo
15  {
16  public SpriteInfo()
17  {
18  CenterFromMiddle = true;
19  }
20 
21  /// <summary>
22  /// The position of the center of the image in pixels.
23  /// </summary>
24  [DataMember(40)]
25  public Vector2 Center;
26 
27  /// <summary>
28  /// Gets or sets the value indicating position provided to <see cref="Center"/> is from the middle of the sprite region or from the left/top corner.
29  /// </summary>
30  [DataMember(50)]
31  [DefaultValue(true)]
32  public bool CenterFromMiddle { get; set; }
33  }
34 }
Represents a two dimensional mathematical vector.
Definition: Vector2.cs:42
Vector2 Center
The position of the center of the image in pixels.
Definition: SpriteInfo.cs:25
Describes various information about an image.
Definition: ImageInfo.cs:14