PageRenderTime 31ms CodeModel.GetById 1ms RepoModel.GetById 1ms 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
  1. package
  2. {
  3. import org.flixel.*;
  4. public class MenuState extends FlxState
  5. {
  6. private var playButton:FlxButton;
  7. private var devButton:FlxButton;
  8. private var Title:FlxText;
  9. override public function create():void
  10. {
  11. FlxG.bgColor = 0xff000000;
  12. Title = new FlxText(FlxG.width / 2, FlxG.height / 3, 100, "$(ProjectID)")
  13. Title.setFormat(null, 64, 0xFFFFFF, "center", 0xffffff);
  14. add(Title);
  15. devButton = new FlxButton(FlxG.width/2-40,FlxG.height / 3 + 60, "Insert Site", onSite);
  16. devButton.soundOver = null; //replace with mouseOver sound
  17. devButton.color = 0xffD4D943;
  18. devButton.label.color = 0xffD8EBA2;
  19. add(devButton);
  20. playButton = new FlxButton(FlxG.width/2-40,FlxG.height / 3 + 100, "Click To Play", onPlay);
  21. playButton.soundOver = devButton.soundOver;
  22. playButton.color = devButton.color;
  23. playButton.label.color = devButton.label.color;
  24. add(playButton);
  25. FlxG.mouse.show();
  26. }
  27. override public function update():void
  28. {
  29. super.update();
  30. }
  31. protected function onSite():void
  32. {
  33. FlxU.openURL("http://example.com/"); //replace with your site's URL
  34. }
  35. protected function onPlay():void
  36. {
  37. playButton.exists = false;
  38. FlxG.switchState(new PlayState());
  39. }
  40. }
  41. }