Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions source/funkin/game/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1539,22 +1539,24 @@ class PlayState extends MusicBeatState
* @param strumLine The strumline to get the camera position of.
* @param pos The position to put the camera position in. If `null`, a new FlxPoint will be created.
* @param ignoreInvisible Whenever invisible characters should be ignored.
* @param ignoreInactive Whether inactive characters should be ignored.
**/
public inline function getStrumlineCamPos(strumLine:Int, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true):CamPosData {
return getCharactersCamPos(strumLines.members[strumLine].characters, pos, ignoreInvisible);
public inline function getStrumlineCamPos(strumLine:Int, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true, ?ignoreInactive = false):CamPosData {
return getCharactersCamPos(strumLines.members[strumLine].characters, pos, ignoreInvisible, ignoreInactive);
}

/**
* Returns the camera position of the specified characters.
* @param chars The characters to get the camera position of.
* @param pos The position to put the camera position in. If `null`, a new FlxPoint will be created.
* @param ignoreInvisible Whenever invisible characters should be ignored.
* @param ignoreInactive Whether inactive characters should be ignored.
**/
public dynamic function getCharactersCamPos(chars:Array<Character>, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true):CamPosData {
public dynamic function getCharactersCamPos(chars:Array<Character>, ?pos:FlxPoint = null, ?ignoreInvisible:Bool = true, ?ignoreInactive = false):CamPosData {
if (pos == null) pos = FlxPoint.get();
var amount = 0;
var amount:Int = 0;
for(c in chars) {
if (c == null || (ignoreInvisible && !c.visible)) continue;
if (c == null || (ignoreInvisible && (c.alpha <= 0 || !c.visible || !c.exists)) || (ignoreInactive && !c.active)) continue;
var cpos = c.getCameraPosition();
pos.x += cpos.x;
pos.y += cpos.y;
Expand Down