-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom FlxCameras to be used on LuaUtils.cameraFromString
#14430
Conversation
I would probably move this functionality into the |
Something like this? public static function cameraFromString(cam:String):FlxCamera {
switch(cam.toLowerCase()) {
case 'camgame' | 'game': return PlayState.instance.camGame;
case 'camhud' | 'hud': return PlayState.instance.camHUD;
case 'camother' | 'other': return PlayState.instance.camOther;
}
var camera:Dynamic = PlayState.instance.variables.get(cam);
if (camera == null || !Std.isOfType(camera, FlxCamera)) camera = PlayState.instance.camGame;
return camera;
} |
yea, looks good |
setObjectCamera
LuaUtils.cameraFromString
Allow custom FlxCameras to be used so long as they are in the
variables
map