Ejemplo n.º 1
0
        public Sprite(QuadSource source, SourceRect sourceRect, Alignments alignment = Alignments.Center,
                      SpriteModifiers mods = SpriteModifiers.None) : base(alignment, mods)
        {
            this.source     = source;
            this.sourceRect = sourceRect;

            data = new float[QuadSize];
        }
Ejemplo n.º 2
0
 protected Component2D(Alignments alignment, SpriteModifiers mods)
 {
     Alignment     = alignment;
     Mods          = mods;
     flags         = new Flags <TransformFlags>(TransformFlags.IsSourceChanged);
     positionField = new RenderPosition2DField(flags);
     scaleField    = new RenderScale2DField(flags);
     rotationField = new RenderRotationField(flags);
     colorField    = new RenderColorField(flags);
     IsDrawEnabled = true;
 }
Ejemplo n.º 3
0
        protected Component2D(Alignments alignment)
        {
            this.alignment = alignment;

            scale           = vec2.Ones;
            color           = Color.White;
            mods            = SpriteModifiers.None;
            positionChanged = true;
            sourceChanged   = true;
            colorChanged    = true;
        }
Ejemplo n.º 4
0
 public Sprite(QuadSource source, Alignments alignment = Alignments.Center,
               SpriteModifiers mods = SpriteModifiers.None) : this(source, new SourceRect(), alignment, mods)
 {
 }
Ejemplo n.º 5
0
 public Sprite(string filename, SourceRect sourceRect, Alignments alignment = Alignments.Center,
               SpriteModifiers mods  = SpriteModifiers.None, TextureWraps wrap = TextureWraps.Repeat,
               TextureFilters filter = TextureFilters.Nearest) :
     this(ContentCache.GetTexture(filename, false, true, wrap, filter), sourceRect, alignment, mods)
 {
 }