class PauseOptions
package substates
extends OptionsMenu › MusicBeatState › ModchartMusicBeatState › FlxUIState › FlxTransitionableState › FlxState › FlxTypedContainer › FlxTypedGroup › FlxBasic
import substates.PauseSubState
@:directlyUsed@:build(hscript.macros.ClassExtendMacro.build())Constructor
Methods
Inherited Variables
Defined by OptionsMenu
@:value(["Categories" => [new PageOption("Gameplay", "Gameplay", "Change gameplay-related options,\nsuch as downscroll and ghost tapping."), new PageOption("Graphics", "Graphics", "Change graphical-related options,\nsuch as max FPS."), new PageOption("Misc", "Misc", "Change miscellaneous options that\ndon't fit in the other categories."), new PageOption("Mod Options", "Mod Options", "Change options for specific mods."), new PageOption("Developer Options", "Developer Options", "Change options for developing mods.")], "Gameplay" => [new PageOption("Back", "Categories", "Go back to the main menu."), new GameSubStateOption("Binds", substates.ControlMenuSubstate, "Change key bindings."), new BoolOption("Key Bind Reminders", "extraKeyReminders", "Should key binding reminders show up\nwhen playing a non-4-key song."), new GameSubStateOption("Song Offset", substates.SongOffsetMenu, "Change the offset of the song."), new PageOption("Judgements", "Judgements", "Change settings related to judgments.\n(sick, good, bad, etc.)"), new PageOption("Input Options", "Input Options", "Change options related to note inputs."), new BoolOption("Downscroll", "downscroll", "Toggle downscroll."), new BoolOption("Middlescroll", "middlescroll", "Toggle middlescroll."), new BoolOption("Bot", "botplay", "Toggle botplay for songs.\nUseful for showcasing hard charts."), new BoolOption("Quick Restart", "quickRestart", "When toggled, the game over animation will not play."), new BoolOption("No Death", "noDeath", "When toggled, the player is unable to die."), new BoolOption("Use Custom Scrollspeed", "useCustomScrollSpeed", "When toggled, a custom scroll speed will be used."), new GameSubStateOption("Custom Scroll Speed", substates.ScrollSpeedMenu, "Change the value of the custom scroll speed."), new StringSaveOption("Hitsound", CoolUtil.coolTextFile(Paths.txt("hitsoundList")), "hitsound", "Change the hitsound used when hitting a note.")], "Graphics" => [new PageOption("Back", "Categories", "Go back to the main menu."), new PageOption("Note Options", "Note Options", "Change note-related options."), new PageOption("Info Display", "Info Display", "Change optiosn related to the info display.\n(FPS counter, memory display, etc)."), new PageOption("Optimizations", "Optimizations", "Change optimization options, such as anitaliasing."), new GameSubStateOption("Max FPS", substates.MaxFPSMenu, "Change the maximum framerate."), new BoolOption("VSync", "vSync", "Toggle VSync."), new BoolOption("Bigger Score Text", "biggerScoreInfo", "When toggled, the score text will have a larger font."), new BoolOption("Bigger Info Text", "biggerInfoText", "When toggled, the time bar will have a larger font."), new StringSaveOption("Time Bar Style", ["leather engine", "psych engine", "old kade engine"], "timeBarStyle", "Change the style of the time bar."), new PageOption("Screen Effects", "Screen Effects", "Toggle screen effect options, such as camera zooming and shaders."), new GameStateOption("Change Hud Settings", ui.HUDAdjustment, "Change the position of hud objects, such as the ratings.")], "Misc" => [new PageOption("Back", "Categories", "Go back to the main menu."), new BoolOption("Friday Night Title Music", "nightMusic", "When toggled, the music for playing\non a friday night will always play."), new BoolOption("Freeplay Music", "freeplayMusic", "When toggled, instrumentals for freeplay songs will auto play."), new BoolOption("Discord RPC", "discordRPC", "Toggles discord rich presence."), new StringSaveOption("Cutscenes Play On", ["story", "freeplay", "both"], "cutscenePlaysOn", "Change when cutscenes play."), new StringSaveOption("Play As", ["bf", "opponent"], "playAs", "Change which side of the chart you play."), new BoolOption("Disable Debug Menus", "disableDebugMenus", "Disable debug menus, such as the chart editor."), new BoolOption("Invisible Notes", "invisibleNotes", "Makes notes invisible.\n(why would you want this?)"), new BoolOption("Auto Pause", "autoPause", "Will the game automatically pause when losing focus."), new BoolOption("Load Asynchronously", "loadAsynchronously", "Loads some elements of the game will be loaded\nasyncrnously to speed up load times."), new BoolOption("Flixel Splash Screen", "flixelStartupScreen", "Toggles the haxeflixel startup splash screen."), new BoolOption("Skip Results", "skipResultsScreen", "When toggled, the results screen will be skipped."), new BoolOption("Check For Updates", "checkForUpdates", "When checked, the game will check for updates on startup."), new BoolOption("Show Score", "showScore", "Shows the current score."), new BoolOption("Dinnerbone Mode", "dinnerbone", "Dinnerbone mode."), new GameSubStateOption("Import Old Scores", substates.ImportHighscoresSubstate, "Import scores from legacy leather engine versions.")], "Optimizations" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new BoolOption("Antialiasing", "antialiasing", "When toggled, antialiasing will be enabled,\nmaking sprites smoother at the cost of some performance.\n(Should only really matter on really low-end devices)"), new BoolOption("Low Quality", "lowQuality", "When toggled, the game will not load\nunneeded sprites to improve performance.\n(when possible)"), new BoolOption("Health Icons", "healthIcons", "Toggles health icons."), new BoolOption("Health Bar", "healthBar", "Toggles the health bar."), new BoolOption("Ratings and Combo", "ratingsAndCombo", "When toggled, ratings and combo popups will be displayed."), new BoolOption("Chars And BGs", "charsAndBGs", "When not toggled, the game will\nhide characters and stages while ingame."), new BoolOption("Menu Backgrounds", "menuBGs", "When not toggled, color rectangles will be\nloaded instead of the menu background image."), new BoolOption("Optimized Characters", "optimizedChars", "When toggled, the game will load optimized spritesheets,\nremoving all unneeded animations (when possible)"), new BoolOption("Animated Backgrounds", "animatedBGs", "When not toggled, the game will load non-animated\nversions of stage sprites (when possible)"), new BoolOption("Preload Stage Events", "preloadChangeBGs", "When toggled, the game will preload stage change events,\nincreasing memory usage,\nbut will prevent lag spikes on stage change."), new BoolOption("Persistent Cached Data", "memoryLeaks", "When toggled, the game will never clear stored memory,\nspeeding up load times.\n(WARNING: Can lead to VERY high memory usage)"), new BoolOption("VRAM Sprites", "vramSprites", "When toggled, the game will try and store\nsprites in your GPU, saving on RAM.\nTurn this off if you have a bad GPU."), new BoolOption("Optimized Modcharts", "optimizedModcharts", "When toggled, modchart sustains will use a more\noptimized renderer,at the cost of stretchy sustains.")], "Info Display" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new DisplayFontOption("Display Font", ["_sans", Assets.getFont(Paths.font("vcr.ttf")).fontName, Assets.getFont(Paths.font("pixel.otf")).fontName], "infoDisplayFont", "Change the font used for the info display."), new BoolOption("FPS Counter", "fpsCounter", "Should the FPS counter be shown?"), new BoolOption("Memory Counter", "memoryCounter", "Should the memory counter be shown?"), new BoolOption("Version Display", "versionDisplay", "Should the engine version be shown?"), new BoolOption("Commit Hash", "showCommitHash", "Should the hash for the current commit be shown?")], "Judgements" => [new PageOption("Back", "Gameplay", "Go back to the gameplay menu."), new GameSubStateOption("Timings", substates.JudgementMenu, "Edit the timings for ratings."), new StringSaveOption("Rating Mode", ["psych", "simple", "complex"], "ratingType", "Change how ratings are calculated."), new BoolOption("Marvelous Ratings", "marvelousRatings", "When toggled, marvelous ratings will be shown,\nelse, sick will be the max rating."), new BoolOption("Show Rating Count", "sideRatings", "Should ratings be shown on the side of the screen?")], "Input Options" => [new PageOption("Back", "Gameplay", "Go back to the gameplay menu."), new StringSaveOption("Input Mode", ["standard", "rhythm"], "inputSystem", "Change how inputs work."), new BoolOption("Anti Mash", "antiMash", "When toggled, mashing keys will punish the player."), new BoolOption("Shit gives Miss", "missOnShit", "When toggled, getting a \"shit\" rating will also count as a miss."), new BoolOption("Ghost Tapping", "ghostTapping", "When not toggled, hitting a key\nat the wrong time will give a miss."), new BoolOption("Gain Misses on Sustains", "missOnHeldNotes", "When toggled, each sustain segment will give misses."), new BoolOption("Death On Miss", "noHit", "When toggled, getting a miss will cause a death.\n(useful for when trying to FC a song.)"), new BoolOption("Reset Button", "resetButton", "When toggled, enables a keybind for causing an instant death.")], "Note Options" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new GameSubStateOption("Note BG Alpha", substates.NoteBGAlphaMenu, "Change the alpha of the note lane underlay."), new BoolOption("Enemy Note Glow", "enemyStrumsGlow", "When toggled, enemy strums will\nlight up when the enemy hits a note."), new BoolOption("Player Note Splashes", "playerNoteSplashes", "When toggled, note splashes will show up\nwhen the player hits a \"sick\" or higher rating."), new BoolOption("Enemy Note Splashes", "opponentNoteSplashes", "When toggled, note splashes will show up\nwhen the enemy hits a \"sick\" or higher rating."), new BoolOption("Note Accuracy Text", "displayMs", "Toggles a text popup showing how early or late you hit a note."), new GameSubStateOption("Note Colors", substates.NoteColorSubstate, "Change the colors of notes."), new BoolOption("Color Quantization", "colorQuantization", "When toggled, note colors will be changed depending on the beat."), new GameSubStateOption("UI Skin", substates.UISkinSelect, "Change the UI skin for notes and menus.")], "Screen Effects" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new BoolOption("Camera Tracks Direction", "cameraTracksDirections", "When toggled, the camera will follow the direction of the note."), new BoolOption("Camera Bounce", "cameraZooms", "When toggled, the game and hud will zoom in on beat."), new BoolOption("Flashing Lights", "flashingLights", "Toggles flashing lights."), new BoolOption("Screen Shake", "screenShakes", "Toggles screen shake effects."), new BoolOption("Shaders", "shaders", "Toggles shaders.")], "Developer Options" => [new PageOption("Back", "Categories", "Go back to the main menu."), new BoolOption("Developer Mode", "developer", "When toggled, enables developer tools.\n(traced lines display, toolbox, etc)"), new DeveloperOption("Show Traced Lines", "showTracedLines", "When toggled, the info display will show the\nnumber of traced lines and errors by the game"), new DeveloperOption("Throw Exception On Error", "throwExceptionOnError", "When toggled, the game will throw an\nexception when an error is thrown."), new DeveloperOption("Auto Open Charter", "autoOpenCharter", "When toggled, the game will automatically\nopen the chart editor when no chart is found."), new StepperSaveDeveloperOption("Chart Backup Interval", 1, 10, "backupDuration", 1, "Change how long the game will wait\nbefore creating a chart backup.\n(in minutes.)")], "Mod Options" => [new PageOption("Back", "Categories", "Go back to the main menu.")]])pages:Map<String, Array<Option>> = ["Categories" => [new PageOption("Gameplay", "Gameplay", "Change gameplay-related options,\nsuch as downscroll and ghost tapping."), new PageOption("Graphics", "Graphics", "Change graphical-related options,\nsuch as max FPS."), new PageOption("Misc", "Misc", "Change miscellaneous options that\ndon't fit in the other categories."), new PageOption("Mod Options", "Mod Options", "Change options for specific mods."), new PageOption("Developer Options", "Developer Options", "Change options for developing mods.")], "Gameplay" => [new PageOption("Back", "Categories", "Go back to the main menu."), new GameSubStateOption("Binds", substates.ControlMenuSubstate, "Change key bindings."), new BoolOption("Key Bind Reminders", "extraKeyReminders", "Should key binding reminders show up\nwhen playing a non-4-key song."), new GameSubStateOption("Song Offset", substates.SongOffsetMenu, "Change the offset of the song."), new PageOption("Judgements", "Judgements", "Change settings related to judgments.\n(sick, good, bad, etc.)"), new PageOption("Input Options", "Input Options", "Change options related to note inputs."), new BoolOption("Downscroll", "downscroll", "Toggle downscroll."), new BoolOption("Middlescroll", "middlescroll", "Toggle middlescroll."), new BoolOption("Bot", "botplay", "Toggle botplay for songs.\nUseful for showcasing hard charts."), new BoolOption("Quick Restart", "quickRestart", "When toggled, the game over animation will not play."), new BoolOption("No Death", "noDeath", "When toggled, the player is unable to die."), new BoolOption("Use Custom Scrollspeed", "useCustomScrollSpeed", "When toggled, a custom scroll speed will be used."), new GameSubStateOption("Custom Scroll Speed", substates.ScrollSpeedMenu, "Change the value of the custom scroll speed."), new StringSaveOption("Hitsound", CoolUtil.coolTextFile(Paths.txt("hitsoundList")), "hitsound", "Change the hitsound used when hitting a note.")], "Graphics" => [new PageOption("Back", "Categories", "Go back to the main menu."), new PageOption("Note Options", "Note Options", "Change note-related options."), new PageOption("Info Display", "Info Display", "Change optiosn related to the info display.\n(FPS counter, memory display, etc)."), new PageOption("Optimizations", "Optimizations", "Change optimization options, such as anitaliasing."), new GameSubStateOption("Max FPS", substates.MaxFPSMenu, "Change the maximum framerate."), new BoolOption("VSync", "vSync", "Toggle VSync."), new BoolOption("Bigger Score Text", "biggerScoreInfo", "When toggled, the score text will have a larger font."), new BoolOption("Bigger Info Text", "biggerInfoText", "When toggled, the time bar will have a larger font."), new StringSaveOption("Time Bar Style", ["leather engine", "psych engine", "old kade engine"], "timeBarStyle", "Change the style of the time bar."), new PageOption("Screen Effects", "Screen Effects", "Toggle screen effect options, such as camera zooming and shaders."), new GameStateOption("Change Hud Settings", ui.HUDAdjustment, "Change the position of hud objects, such as the ratings.")], "Misc" => [new PageOption("Back", "Categories", "Go back to the main menu."), new BoolOption("Friday Night Title Music", "nightMusic", "When toggled, the music for playing\non a friday night will always play."), new BoolOption("Freeplay Music", "freeplayMusic", "When toggled, instrumentals for freeplay songs will auto play."), new BoolOption("Discord RPC", "discordRPC", "Toggles discord rich presence."), new StringSaveOption("Cutscenes Play On", ["story", "freeplay", "both"], "cutscenePlaysOn", "Change when cutscenes play."), new StringSaveOption("Play As", ["bf", "opponent"], "playAs", "Change which side of the chart you play."), new BoolOption("Disable Debug Menus", "disableDebugMenus", "Disable debug menus, such as the chart editor."), new BoolOption("Invisible Notes", "invisibleNotes", "Makes notes invisible.\n(why would you want this?)"), new BoolOption("Auto Pause", "autoPause", "Will the game automatically pause when losing focus."), new BoolOption("Load Asynchronously", "loadAsynchronously", "Loads some elements of the game will be loaded\nasyncrnously to speed up load times."), new BoolOption("Flixel Splash Screen", "flixelStartupScreen", "Toggles the haxeflixel startup splash screen."), new BoolOption("Skip Results", "skipResultsScreen", "When toggled, the results screen will be skipped."), new BoolOption("Check For Updates", "checkForUpdates", "When checked, the game will check for updates on startup."), new BoolOption("Show Score", "showScore", "Shows the current score."), new BoolOption("Dinnerbone Mode", "dinnerbone", "Dinnerbone mode."), new GameSubStateOption("Import Old Scores", substates.ImportHighscoresSubstate, "Import scores from legacy leather engine versions.")], "Optimizations" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new BoolOption("Antialiasing", "antialiasing", "When toggled, antialiasing will be enabled,\nmaking sprites smoother at the cost of some performance.\n(Should only really matter on really low-end devices)"), new BoolOption("Low Quality", "lowQuality", "When toggled, the game will not load\nunneeded sprites to improve performance.\n(when possible)"), new BoolOption("Health Icons", "healthIcons", "Toggles health icons."), new BoolOption("Health Bar", "healthBar", "Toggles the health bar."), new BoolOption("Ratings and Combo", "ratingsAndCombo", "When toggled, ratings and combo popups will be displayed."), new BoolOption("Chars And BGs", "charsAndBGs", "When not toggled, the game will\nhide characters and stages while ingame."), new BoolOption("Menu Backgrounds", "menuBGs", "When not toggled, color rectangles will be\nloaded instead of the menu background image."), new BoolOption("Optimized Characters", "optimizedChars", "When toggled, the game will load optimized spritesheets,\nremoving all unneeded animations (when possible)"), new BoolOption("Animated Backgrounds", "animatedBGs", "When not toggled, the game will load non-animated\nversions of stage sprites (when possible)"), new BoolOption("Preload Stage Events", "preloadChangeBGs", "When toggled, the game will preload stage change events,\nincreasing memory usage,\nbut will prevent lag spikes on stage change."), new BoolOption("Persistent Cached Data", "memoryLeaks", "When toggled, the game will never clear stored memory,\nspeeding up load times.\n(WARNING: Can lead to VERY high memory usage)"), new BoolOption("VRAM Sprites", "vramSprites", "When toggled, the game will try and store\nsprites in your GPU, saving on RAM.\nTurn this off if you have a bad GPU."), new BoolOption("Optimized Modcharts", "optimizedModcharts", "When toggled, modchart sustains will use a more\noptimized renderer,at the cost of stretchy sustains.")], "Info Display" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new DisplayFontOption("Display Font", ["_sans", Assets.getFont(Paths.font("vcr.ttf")).fontName, Assets.getFont(Paths.font("pixel.otf")).fontName], "infoDisplayFont", "Change the font used for the info display."), new BoolOption("FPS Counter", "fpsCounter", "Should the FPS counter be shown?"), new BoolOption("Memory Counter", "memoryCounter", "Should the memory counter be shown?"), new BoolOption("Version Display", "versionDisplay", "Should the engine version be shown?"), new BoolOption("Commit Hash", "showCommitHash", "Should the hash for the current commit be shown?")], "Judgements" => [new PageOption("Back", "Gameplay", "Go back to the gameplay menu."), new GameSubStateOption("Timings", substates.JudgementMenu, "Edit the timings for ratings."), new StringSaveOption("Rating Mode", ["psych", "simple", "complex"], "ratingType", "Change how ratings are calculated."), new BoolOption("Marvelous Ratings", "marvelousRatings", "When toggled, marvelous ratings will be shown,\nelse, sick will be the max rating."), new BoolOption("Show Rating Count", "sideRatings", "Should ratings be shown on the side of the screen?")], "Input Options" => [new PageOption("Back", "Gameplay", "Go back to the gameplay menu."), new StringSaveOption("Input Mode", ["standard", "rhythm"], "inputSystem", "Change how inputs work."), new BoolOption("Anti Mash", "antiMash", "When toggled, mashing keys will punish the player."), new BoolOption("Shit gives Miss", "missOnShit", "When toggled, getting a \"shit\" rating will also count as a miss."), new BoolOption("Ghost Tapping", "ghostTapping", "When not toggled, hitting a key\nat the wrong time will give a miss."), new BoolOption("Gain Misses on Sustains", "missOnHeldNotes", "When toggled, each sustain segment will give misses."), new BoolOption("Death On Miss", "noHit", "When toggled, getting a miss will cause a death.\n(useful for when trying to FC a song.)"), new BoolOption("Reset Button", "resetButton", "When toggled, enables a keybind for causing an instant death.")], "Note Options" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new GameSubStateOption("Note BG Alpha", substates.NoteBGAlphaMenu, "Change the alpha of the note lane underlay."), new BoolOption("Enemy Note Glow", "enemyStrumsGlow", "When toggled, enemy strums will\nlight up when the enemy hits a note."), new BoolOption("Player Note Splashes", "playerNoteSplashes", "When toggled, note splashes will show up\nwhen the player hits a \"sick\" or higher rating."), new BoolOption("Enemy Note Splashes", "opponentNoteSplashes", "When toggled, note splashes will show up\nwhen the enemy hits a \"sick\" or higher rating."), new BoolOption("Note Accuracy Text", "displayMs", "Toggles a text popup showing how early or late you hit a note."), new GameSubStateOption("Note Colors", substates.NoteColorSubstate, "Change the colors of notes."), new BoolOption("Color Quantization", "colorQuantization", "When toggled, note colors will be changed depending on the beat."), new GameSubStateOption("UI Skin", substates.UISkinSelect, "Change the UI skin for notes and menus.")], "Screen Effects" => [new PageOption("Back", "Graphics", "Go back to the graphics menu."), new BoolOption("Camera Tracks Direction", "cameraTracksDirections", "When toggled, the camera will follow the direction of the note."), new BoolOption("Camera Bounce", "cameraZooms", "When toggled, the game and hud will zoom in on beat."), new BoolOption("Flashing Lights", "flashingLights", "Toggles flashing lights."), new BoolOption("Screen Shake", "screenShakes", "Toggles screen shake effects."), new BoolOption("Shaders", "shaders", "Toggles shaders.")], "Developer Options" => [new PageOption("Back", "Categories", "Go back to the main menu."), new BoolOption("Developer Mode", "developer", "When toggled, enables developer tools.\n(traced lines display, toolbox, etc)"), new DeveloperOption("Show Traced Lines", "showTracedLines", "When toggled, the info display will show the\nnumber of traced lines and errors by the game"), new DeveloperOption("Throw Exception On Error", "throwExceptionOnError", "When toggled, the game will throw an\nexception when an error is thrown."), new DeveloperOption("Auto Open Charter", "autoOpenCharter", "When toggled, the game will automatically\nopen the chart editor when no chart is found."), new StepperSaveDeveloperOption("Chart Backup Interval", 1, 10, "backupDuration", 1, "Change how long the game will wait\nbefore creating a chart backup.\n(in minutes.)")], "Mod Options" => [new PageOption("Back", "Categories", "Go back to the main menu.")]]
Defined by MusicBeatState
Defined by ModchartMusicBeatState
Defined by FlxUIState
Defined by FlxTransitionableState
Defined by FlxState
@:value(true)destroySubStates:Bool = true
If substates get destroyed when they are closed, setting this to
false
might reduce state creation time, at greater memory cost.
@:value(true)persistentDraw:Bool = true
Determines whether the current state is drawn, even when it is not the active state.
For example, if you have your game state open first, and then you push a pause state on top of it,
if this is set to true
, the game state would still continue to be drawn behind that pause state.
By default, this is set to true
, so the background states will continue to be "drawn" behind the current state.
If you do not want background states to be visible
when you have a different state on top,
then you should set this to false
for improved performance.
@:value(false)persistentUpdate:Bool = false
Determines whether the current state is updated, even when it is not the active state.
For example, if you have your game state open first, and then you push a pause state on top of it,
if this is set to true
, the game state would still continue to be updated in the background.
By default, this is set to false
, so the background states will continue to be "paused" when they are not active.
read onlysubStateClosed:FlxTypedSignal<FlxSubState ‑> Void>
A FlxSignal
that dispatches when a sub state is closed from this state.
4.9.0
.read onlysubStateOpened:FlxTypedSignal<FlxSubState ‑> Void>
A FlxSignal
that dispatches when a sub state is opened from this state.
4.9.0
.Defined by FlxTypedGroup
@:value(0)read onlylength:Int = 0
The number of entries in the members array. For performance and safety you should check this
variable instead of members.length
unless you really know what you're doing!
maxSize:Int
The maximum capacity of this group. Default is 0
, meaning no max capacity, and the group can just grow.
read onlymemberAdded:FlxTypedSignal<T ‑> Void>
A FlxSignal
that dispatches when a child is added to this group.
4.4.0
.read onlymemberRemoved:FlxTypedSignal<T ‑> Void>
A FlxSignal
that dispatches when a child is removed from this group.
4.4.0
.@:value(true)zIndexesAllowed:Bool = true
Whether or not objects are allowed to have Z-Indexes in this group. If this is disabled, objects will render in the order they are added to the group.
This is a flag since handling Z-Indexes can be expensive, depending on how many objects are in the group.
Defined by FlxBasic
@:value(idEnumerator++)ID:Int = idEnumerator++
A unique ID starting from 0 and increasing by 1 for each subsequent FlxBasic
that is created.
@:value(true)alive:Bool = true
Useful state for many game objects - "dead" (!alive
) vs alive
. kill()
and
revive()
both flip this switch (along with exists
, but you can override that).
cameras:Array<FlxCamera>
This determines on which FlxCamera
s this object will be drawn. If it is null
/ has not been
set, it uses the list of default draw targets, which is controlled via FlxG.camera.setDefaultDrawTarget
as well as the DefaultDrawTarget
argument of FlxG.camera.add
.
read onlycontainer:Null<FlxContainer>
The parent containing this basic, typically if you check this recursively you should reach the state
5.7.0
.Inherited Methods
Defined by OptionsMenu
Defined by MusicBeatState
Defined by FlxUIState
Defined by FlxTransitionableState
transitionOut(?OnExit:() ‑> Void):Void
Starts the out-transition. Can be called manually at any time.
Defined by FlxState
onFocus():Void
This method is called after the game receives focus. Can be useful for third party libraries, such as tweening engines.
onFocusLost():Void
This method is called after the game loses focus. Can be useful for third party libraries, such as tweening engines.
Defined by FlxTypedGroup
add(basic:T):T
Adds a new FlxBasic
subclass (FlxBasic
, FlxSprite
, Enemy
, etc) to the group.
FlxGroup
will try to replace a null
member of the array first.
Failing that, FlxGroup
will add it to the end of the member array.
WARNING: If the group has a maxSize
that has already been met,
the object will NOT be added to the group!
Parameters:
basic | The |
---|
Returns:
The same FlxBasic
object that was passed in.
any(func:T ‑> Bool):Bool
Tests whether any member satisfies the function.
Parameters:
func | The function that tests the members |
---|
5.4.0
.clear():Void
Remove all instances of FlxBasic
subclasses (FlxSprite
, FlxTileblock
, etc) from the list.
WARNING: does not destroy()
or kill()
any of these objects!
countDead():Int
Call this function to find out how many members of the group are dead.
Returns:
The number of FlxBasic
s flagged as dead. Returns -1
if group is empty.
countLiving():Int
Call this function to find out how many members of the group are not dead.
Returns:
The number of FlxBasic
s flagged as not dead. Returns -1
if group is empty.
every(func:T ‑> Bool):Bool
Tests whether every member satisfies the function.
Parameters:
func | The function that tests the members |
---|
5.4.0
.@:value({ recurse : false })forEach(func:T ‑> Void, recurse:Bool = false):Void
Applies a function to all members.
Parameters:
func | A function that modifies one element at a time. |
---|---|
recurse | Whether or not to apply the function to members of subgroups as well. |
@:value({ recurse : false })forEachAlive(func:T ‑> Void, recurse:Bool = false):Void
Applies a function to all alive
members.
Parameters:
func | A function that modifies one element at a time. |
---|---|
recurse | Whether or not to apply the function to members of subgroups as well. |
@:value({ recurse : false })forEachDead(func:T ‑> Void, recurse:Bool = false):Void
Applies a function to all dead members.
Parameters:
func | A function that modifies one element at a time. |
---|---|
recurse | Whether or not to apply the function to members of subgroups as well. |
@:value({ recurse : false })forEachExists(func:T ‑> Void, recurse:Bool = false):Void
Applies a function to all existing members.
Parameters:
func | A function that modifies one element at a time. |
---|---|
recurse | Whether or not to apply the function to members of subgroups as well. |
@:value({ recurse : false })forEachOfType<K>(objectClass:Class<K>, func:K ‑> Void, recurse:Bool = false):Void
getFirst(func:T ‑> Bool):Null<T>
Searches for, and returns the first member that satisfies the function.
Parameters:
func | The function that tests the members |
---|
5.4.0
.getFirstAlive():Null<T>
@:value({ force : false })getFirstAvailable(?objectClass:Class<T>, force:Bool = false):Null<T>
Call this function to retrieve the first object with exists == false
in the group.
This is handy for recycling in general, e.g. respawning enemies.
Parameters:
objectClass | An optional parameter that lets you narrow the results to instances of this particular class. |
---|---|
force | Force the object to be an |
Returns:
A FlxBasic
currently flagged as not existing.
getFirstDead():Null<T>
getFirstExisting():Null<T>
getFirstIndex(func:T ‑> Bool):Int
Searches for, and returns the index of the first member that satisfies the function.
Parameters:
func | The function that tests the members |
---|
5.4.0
.getFirstNull():Int
Call this function to retrieve the first index set to null
.
Returns -1
if no index stores a null
object.
Returns:
An Int
indicating the first null
slot in the group.
getLast(func:T ‑> Bool):Null<T>
Searches for, and returns the last member that satisfies the function.
Parameters:
func | The function that tests the members |
---|
5.4.0
.getLastIndex(func:T ‑> Bool):Int
Searches for, and returns the index of the last member that satisfies the function.
Parameters:
func | The function that tests the members |
---|
5.4.0
.@:value({ length : 0, startIndex : 0 })getRandom(startIndex:Int = 0, length:Int = 0):T
Returns a member at random from the group.
Parameters:
startIndex | Optional offset off the front of the array.
Default value is |
---|---|
length | Optional restriction on the number of values you want to randomly select from. |
Returns:
A FlxBasic
from the members
list.
insert(position:Int, object:T):T
Inserts a new FlxBasic
subclass (FlxBasic
, FlxSprite
, Enemy
, etc)
into the group at the specified position.
FlxGroup
will try to replace a null
member at the specified position of the array first.
Failing that, FlxGroup
will insert it at the position of the member array.
WARNING: If the group has a maxSize
that has already been met,
the object will NOT be inserted to the group!
Parameters:
position | The position in the group where you want to insert the object. |
---|---|
object | The object you want to insert into the group. |
Returns:
The same FlxBasic
object that was passed in.
killMembers():Void
Calls kill()
on the group's unkilled members
. Revive them via reviveMembers()
.
5.4.0
.@:value({ revive : true, force : false })recycle(?objectClass:Class<T>, ?objectFactory:() ‑> T, force:Bool = false, revive:Bool = true):T
Recycling is designed to help you reuse game objects without always re-allocating or "newing" them.
It behaves differently depending on whether maxSize
equals 0
or is bigger than 0
.
maxSize > 0
/ "rotating-recycling" (used by FlxEmitter
):
- at capacity: returns the next object in line, no matter its properties like alive
, exists
etc.
- otherwise: returns a new object.
maxSize == 0
/ "grow-style-recycling"
- tries to find the first object with exists == false
- otherwise: adds a new object to the members
array
WARNING: If this function needs to create a new object, and no object class was provided,
it will return null
instead of a valid object!
Parameters:
objectClass | The class type you want to recycle (e.g. |
---|---|
objectFactory | Optional factory function to create a new object
if there aren't any dead members to recycle.
If |
force | Force the object to be an |
revive | Whether recycled members should automatically be revived
(by calling |
Returns:
A reference to the object that was created.
@:value({ splice : false })remove(basic:T, splice:Bool = false):T
Removes an object from the group.
Parameters:
basic | The |
---|---|
splice | Whether the object should be cut from the array entirely or not. |
Returns:
The removed object.
replace(oldObject:T, newObject:T):T
Replaces an existing FlxBasic
with a new one.
Does not do anything and returns null
if the old object is not part of the group.
Parameters:
oldObject | The object you want to replace. |
---|---|
newObject | The new object you want to use instead. |
Returns:
The new object.
reviveMembers():Void
Calls revive()
on the group's killed members and then on the group itself.
5.4.0
.@:value({ order : FlxSort.ASCENDING })inlinesort(func:(Int, T, T) ‑> Int, order:Int = FlxSort.ASCENDING):Void
Call this function to sort the group according to a particular value and order.
For example, to sort game objects for Zelda-style overlaps you might call
group.sort(FlxSort.byY, FlxSort.ASCENDING)
at the bottom of your FlxState#update()
override.
Parameters:
func | The sorting function to use - you can use one of the premade ones in
|
---|---|
order | A constant that defines the sort order.
Possible values are |
Defined by FlxBasic
getCameras():Array<FlxCamera>
The cameras that will draw this. Use this.cameras
to set specific cameras for this object,
otherwise the container's cameras are used, or the container's container and so on. If there
is no container, say, if this is inside FlxGroups
rather than a FlxContainer
then the
default draw cameras are returned.
5.7.0
.getDefaultCamera():FlxCamera
The main camera that will draw this. Use this.cameras
to set specific cameras for this
object, otherwise the container's camera is used, or the container's container and so on.
If there is no container, say, if this is inside FlxGroups
rather than a FlxContainer
then FlxG.camera
is returned.
5.7.0
.