File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,15 @@ class ModSwitchMenu extends MusicBeatSubstate {
1111 var alphabets : FlxTypedGroup <Alphabet >;
1212 var curSelected : Int = 0 ;
1313
14+ var subCam : FlxCamera ;
15+
1416 public override function create () {
1517 super .create ();
1618
19+ camera = subCam = new FlxCamera ();
20+ subCam .bgColor = 0 ;
21+ FlxG .cameras .add (subCam , false );
22+
1723 var bg = new FlxSprite (0 , 0 ).makeSolid (FlxG .width , FlxG .height , 0xFF000000 );
1824 bg .updateHitbox ();
1925 bg .scrollFactor .set ();
@@ -63,5 +69,12 @@ class ModSwitchMenu extends MusicBeatSubstate {
6369 }
6470 alphabets .members [curSelected ].alpha = 1 ;
6571 }
72+
73+ override function destroy () {
74+ super .destroy ();
75+
76+ if (FlxG .cameras .list .contains (subCam ))
77+ FlxG .cameras .remove (subCam );
78+ }
6679}
6780#end
You can’t perform that action at this time.
0 commit comments