示例#1
0
        public Sprite( float width, float height, Color4 colour )
        {
            myTexture = Texture2D.Blank;

            Position = new Vector2();
            Scale = new Vector2( width, height );
            SubrectOffset = new Vector2( 0, 0 );
            SubrectSize = new Vector2( myTexture.Width, myTexture.Height );
            FlipHorizontal = false;
            FlipVertical = false;
            Rotation = 0;
            UseCentreAsOrigin = false;
            Colour = colour;
        }
示例#2
0
        public Sprite( Texture2D texture, float scale = 1.0f )
        {
            myTexture = texture;

            Position = new Vector2();
            Scale = new Vector2( 1, 1 );
            SubrectOffset = new Vector2( 0, 0 );
            SubrectSize = new Vector2( myTexture.Width, myTexture.Height );
            FlipHorizontal = false;
            FlipVertical = false;
            Rotation = 0;
            UseCentreAsOrigin = false;
            Colour = new Color4( 1.0f, 1.0f, 1.0f, 1.0f );

            Scale = new Vector2( scale, scale );
        }
示例#3
0
        public AnimatedSprite( Texture2D texture, int frameWidth, int frameHeight, double frameRate, float scale = 1.0f )
            : base(texture, scale)
        {
            myFrameWidth = frameWidth;
            myFrameHeight = frameHeight;

            FrameRate = frameRate;

            myStartTime = 0;
            myStopTime = 0;

            SubrectSize = new Vector2( frameWidth, frameHeight );

            FindFrameLocations();

            StartFrame = 0;
            FrameCount = myFrameLocations.Length;

            myLastFrame = -1;
        }
示例#4
0
 public FrameSprite( Texture2D texture, float scale = 1.0f )
     : base(texture, scale)
 {
     myFrameTopLeft = new Vector2();
     myFrameBottomRight = new Vector2();
 }
示例#5
0
文件: Text.cs 项目: vashage/MarsMiner
        public Font( String charMap )
        {
            Texture = Res.Get<Texture2D>( charMap );

            CharSize = new Vector2( Texture.Width / 16, Texture.Height / 16 );
        }
示例#6
0
 static Texture2D()
 {
     Bitmap blankBmp = new Bitmap( 1, 1 );
     blankBmp.SetPixel( 0, 0, Color.White );
     Blank = new Texture2D( blankBmp );
 }