public QSprite(QBehavior script) { Script = script; Source = QRectangle.Empty; Origin = QVector2.Zero; Texture = null; }
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; } } }
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; } } } } }
public QImage(QBehavior script) { Script = script; Texture = null; }
public QImage(QBehavior s, QRectangle source) : this(s) { Source = source; Origin = Source.Center; }