PageRenderTime 92ms CodeModel.GetById 60ms app.highlight 2ms RepoModel.GetById 29ms app.codeStats 0ms

/$(BaseDir)/Projects/115 ActionScript 3 - Flixel 2.5 Project/src/MenuState.as.template

http://github.com/Deviantg33k/Flixel-2.5-FlashDevelop-Template
Unknown | 58 lines | 41 code | 17 blank | 0 comment | 0 complexity | dfac54388901df4b947faf1cf9937a45 MD5 | raw file
 1package
 2{
 3
 4	import org.flixel.*;
 5
 6	public class MenuState extends FlxState
 7	{
 8		
 9		private var playButton:FlxButton;
10		private var devButton:FlxButton;
11		private var Title:FlxText;
12		
13		override public function create():void
14		{
15			FlxG.bgColor = 0xff000000;
16			
17			Title = new FlxText(FlxG.width / 2, FlxG.height / 3, 100, "$(ProjectID)")
18			Title.setFormat(null, 64, 0xFFFFFF, "center", 0xffffff);
19			add(Title);
20			
21			devButton = new FlxButton(FlxG.width/2-40,FlxG.height / 3 + 60, "Insert Site", onSite);
22			devButton.soundOver = null;  //replace with mouseOver sound
23			devButton.color = 0xffD4D943;
24			devButton.label.color = 0xffD8EBA2;
25			add(devButton);
26			
27			playButton = new FlxButton(FlxG.width/2-40,FlxG.height / 3 + 100, "Click To Play", onPlay);
28			playButton.soundOver = devButton.soundOver;
29			playButton.color = devButton.color;
30			playButton.label.color = devButton.label.color;
31			add(playButton);
32			
33			
34			FlxG.mouse.show();
35			
36		}
37		
38		override public function update():void
39		{
40			super.update();	
41		}
42		
43		protected function onSite():void
44		{
45			
46			FlxU.openURL("http://example.com/");  //replace with your site's URL 
47		}
48		
49		protected function onPlay():void
50		{
51			playButton.exists = false;
52			FlxG.switchState(new PlayState());
53		}
54		
55		
56	}
57}
58