Sprite nesnesi, width, height

13 Jan
2011

Sprite nesnesi ici bosken boyutlandirilamiyor. Once bir graph olusturup ondan sonra boyutlandirmalisiniz, asagidaki gibi.

	public class ClassName extends Sprite
	{
		private static const WIDTH:int = 300;
		private static const HEIGHT:int = 96;

		public function ClassName()
		{
			this.x = 0;
			this.y = 0;
			this.graphics.beginFill(0xffffff, 0.5);
			this.graphics.drawRect(0, 0, WIDTH, HEIGHT);
			this.graphics.endFill();
			this.width = WIDTH;
			this.height = HEIGHT;
		}
	}
Be Sociable, Share!

Comment Form

You must be logged in to post a comment.

top