[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[m8n] LuaStudio - Initial tests and setup


SwikiCodeRobot @> 768

| sprite sprite2 |
	sprite := Sprite new
		name: 'Sprite 1';
		buttonMode: true;
		yourself.
	sprite graphics
		lineStyle: 2 color: 16r00FF00 alpha: 1.0 pixelHinting: false scaleMode: nil caps: nil joints: nil miterLimit: 3;
		beginFill: 16rF5F5F0 alpha: 1.0;
		drawRect: 0 y: 0 width: 600 height: 300;
		endFill.
sprite2 := Sprite new
		name: 'Sprite 2';
		buttonMode: true;
		yourself.
	sprite2 graphics
		lineStyle: 2 color: 16rFF0000 alpha: 1.0 pixelHinting: false scaleMode: nil caps: nil joints: nil miterLimit: 3;
		beginFill: 16rFF0000 alpha: 1.0;
		drawRect: 0 y: 0 width: 200 height: 100;
		endFill.
sprite addChild: sprite2.
	Display stage addChild: sprite.

	sprite	x: 10;y: 10;
		addEventListener: MouseEvent click
		with: [:e| sprite print: 'Click on ', e#target#name. nil ].

	sprite2	x: 20;y: 20;
		addEventListener: MouseEvent click
		with: [:e| sprite2 print: 'Click on ', e#target#name. nil ]