Skip to content

Commit f83e88b

Browse files
ALEStageObject - Custom Cameras
1 parent bf0b034 commit f83e88b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

source/core/structures/ALEStageObject.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ typedef ALEStageObject = {
66
@:optional var classArguments:Array<Dynamic>;
77
@:optional var path:String;
88
@:optional var properties:Any;
9+
@:optional var cameras:Array<String>;
910
@:optional var addMethod:String;
1011
@:optional var highQuality:Bool;
1112
}

source/funkin/visuals/game/Stage.hx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package funkin.visuals.game;
22

33
import utils.ALEFormatter;
44

5+
import flixel.FlxCamera;
56
import flixel.FlxBasic;
67

78
import core.structures.StageArray;
@@ -103,6 +104,19 @@ class Stage
103104
if (props != null)
104105
CoolUtil.setMultiProperty(obj, props);
105106

107+
if (object.cameras != null)
108+
{
109+
obj.cameras = [];
110+
111+
for (camera in object.cameras)
112+
{
113+
final result:Dynamic = Reflect.getProperty(game, camera);
114+
115+
if (result != null && result is FlxCamera)
116+
obj.cameras.push(result);
117+
}
118+
}
119+
106120
obj.exists = false;
107121

108122
obj.updateHitbox();

0 commit comments

Comments
 (0)