-
Notifications
You must be signed in to change notification settings - Fork 3
/
ManuPause.as
executable file
·57 lines (45 loc) · 1.21 KB
/
ManuPause.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package
{
import Buttons.CustomButton;
import flash.display.BitmapData;
import org.flixel.data.FlxPause;
import org.flixel.FlxG;
import org.flixel.FlxSprite;
import org.flixel.FlxState;
import org.flixel.FlxText;
import States.BuildState;
import States.RunState;
/**
* ...
* @author Nicholas 'A' Feinberg
*/
public class ManuPause extends FlxPause
{
public static var pauseButton:CustomButton = null;
public static function pause():void {
//None of this works.
FlxG.mouse.hide();
if (FlxG.state is RunState) {
//render something over the pause button - unsafeBind?
pauseButton.loadGraphic(RunState.play_png).render();
}
FlxState.screen.unsafeBind(FlxG.buffer);
FlxG.mouse.show();
if (FlxG.state is RunState) {
pauseButton.loadGraphic(RunState.pause_png);
}
//Except for this.
FlxG.pause = true;
}
override public function update():void {
super.update();
if (FlxG.mouse.justPressed() && pauseButton)// && pauseButton.moused)
FlxG.pause = false;
}
override public function render():void {
if (FlxG.state is RunState)
return;
super.render();
}
}
}