示例#1
0
 public QSprite(QBehavior script)
 {
     Script  = script;
     Source  = QRectangle.Empty;
     Origin  = QVector2.Zero;
     Texture = null;
 }
示例#2
0
 public QImage(QBehavior s, string textureName) : this(s)
 {
     foreach (var atlas in Script.World.Content.Atlases)
     {
         if (atlas.Rectangles.TryGetValue(textureName, out QRectangle rect))
         {
             Texture = atlas;
             Source  = rect;
         }
     }
 }
示例#3
0
 public QSprite(QBehavior script, QRectangle source) : this(script)
 {
     foreach (var atlas in Script.World.Content.Atlases)
     {
         foreach (var rects in atlas.Rectangles)
         {
             foreach (var qRectangle in rects.Value.Split(source.Width, source.Height))
             {
                 if (source == qRectangle)
                 {
                     Source  = source;
                     Texture = atlas;
                     Origin  = Source.Center;
                 }
             }
         }
     }
 }
示例#4
0
 public QImage(QBehavior script)
 {
     Script  = script;
     Texture = null;
 }
示例#5
0
 public QImage(QBehavior s, QRectangle source) : this(s)
 {
     Source = source;
     Origin = Source.Center;
 }