state scripting

This commit is contained in:
Yoshman29
2022-11-10 14:11:28 +01:00
parent 94d2a3c30d
commit 949b6dc9e5
6 changed files with 120 additions and 9 deletions
@@ -0,0 +1,29 @@
package funkin.scripting.events;
class ResizeEvent extends CancellableEvent {
/**
* New width
*/
public var width:Int;
/**
* New height
*/
public var height:Int;
/**
* Old width (may be null)
*/
public var oldWidth:Null<Int>;
/**
* Old height (may be null)
*/
public var oldHeight:Null<Int>;
public function new(width:Int, height:Int, ?oldWidth:Int, ?oldHeight:Int) {
super();
this.width = width;
this.height = height;
this.oldWidth = oldWidth;
this.oldHeight = oldHeight;
}
}
@@ -1,14 +1,14 @@
package funkin.scripting.events;
import flixel.FlxSubState;
import flixel.FlxState;
class SubstateEvent extends CancellableEvent {
class StateEvent extends CancellableEvent {
/**
* Substate that is about to be opened/closed
*/
public var substate:FlxSubState;
public var substate:FlxState;
public function new(substate:FlxSubState) {
public function new(substate:FlxState) {
super();
this.substate = substate;
}