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; }
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 ); }
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; }
public FrameSprite( Texture2D texture, float scale = 1.0f ) : base(texture, scale) { myFrameTopLeft = new Vector2(); myFrameBottomRight = new Vector2(); }
public Font( String charMap ) { Texture = Res.Get<Texture2D>( charMap ); CharSize = new Vector2( Texture.Width / 16, Texture.Height / 16 ); }
static Texture2D() { Bitmap blankBmp = new Bitmap( 1, 1 ); blankBmp.SetPixel( 0, 0, Color.White ); Blank = new Texture2D( blankBmp ); }