Class NoteField

NoteField class

This class contains the components responsible for displaying notes in gameplay.

The simplest way to get the NoteField in gameplay is SCREENMAN:GetTopScreen():GetChild("PlayerP1"):GetChild("NoteField").

This class inherits all methods from these classes: ActorFrame Actor

Methods

notefield:set_step_callback (callback) Set the function that executes every time the player steps.
notefield:set_set_pressed_callback (callback) Set the function that executes every time the player presses a column.
notefield:set_did_tap_note_callback (callback) Set the function that executes every time the player tapped on a note.
notefield:set_did_hold_note_callback (callback) Set the function that executes every time the player taps on the head of a hold or roll.
notefield:step (column, tns) Run the Step action on a given column and TapNoteScore.
notefield:set_pressed (column) Run the SetPressed action on a given column.
notefield:did_tap_note (column, tns, bright) Run the DidTapNote action on a given column and TapNoteScore.
notefield:did_hold_note (column, hns, bright) Run the DidHoldNote action on a given column and HoldNoteScore.
notefield:get_column_actors () Get the NoteColumnRenderers for each column.
notefield:show_beat_bars (state) Toggle showing the beat bars in the NoteField board (behind the notes).
notefield:show_interval_bars (state) Toggle showing the interval bars in the NoteField board (behind the notes).


Methods

notefield:set_step_callback (callback)
Set the function that executes every time the player steps. The callback function has the parameters (intColumn, TapNoteScore). The callback function returns 2 values, intColumn, TapNoteScore. The point of passing and returning these values is to be able to redirect them.

Parameters:

  • callback func A function to execute later

Returns:

    nil

See also:

notefield:set_set_pressed_callback (callback)
Set the function that executes every time the player presses a column. The callback function has the parameter (intColumn). The callback function returns 1 value, intColumn. The point of passing and returning the column is to be able to redirect column numbers.

Parameters:

  • callback func A function to execute later

Returns:

    nil

See also:

notefield:set_did_tap_note_callback (callback)
Set the function that executes every time the player tapped on a note. The callback function has the parameters (intColumn, TapNoteScore, boolBright). The callback function returns 3 values, intColumn, TapNoteScore, boolBright. The point of passing and returning these values is to be able to redirect them. The boolBright parameter is usually true when the current combo has passed BrightGhostComboThreshold.

Parameters:

  • callback func A function to execute later

Returns:

    nil

See also:

notefield:set_did_hold_note_callback (callback)
Set the function that executes every time the player taps on the head of a hold or roll. The callback function has the parameters (intColumn, HoldNoteScore, boolBright). The callback function returns 3 values, intColumn, HoldNoteScore, boolBright. The point of passing and returning these values is to be able to redirect them. The boolBright parameter is usually true when the current combo has passed BrightGhostComboThreshold.

Parameters:

  • callback func A function to execute later

Returns:

    nil

See also:

notefield:step (column, tns)
Run the Step action on a given column and TapNoteScore. Note that this does not trigger the callback function that can be set from Lua.

Parameters:

  • column int The 1-indexed column to step on, starting from the left.
  • tns TapNoteScore The TapNoteScore to emulate on the given column.

Returns:

    nil
notefield:set_pressed (column)
Run the SetPressed action on a given column. Note that this does not trigger the callback function that can be set from Lua. Setting a column to pressed will set it as unpressed at the next update as long as the button is not held by the player.

Parameters:

  • column int The 1-indexed column to set as pressed, starting from the left.

Returns:

    nil
notefield:did_tap_note (column, tns, bright)
Run the DidTapNote action on a given column and TapNoteScore. Note that this does not trigger the callback function that can be set from Lua.

Parameters:

  • column int The 1-indexed column to trigger DidTapNote, starting from the left.
  • tns TapNoteScore The TapNoteScore to emulate on the given column.
  • bright bool Set to true to signal that the bright state should be active. Bright is usually enabled for combos above BrightGhostComboThreshold.

Returns:

    nil
notefield:did_hold_note (column, hns, bright)
Run the DidHoldNote action on a given column and HoldNoteScore. Note that this does not trigger the callback function that can be set from Lua.

Parameters:

  • column int The 1-indexed column to trigger DidHoldNote, starting from the left.
  • hns HoldNoteScore The HoldNoteScore to emulate on the given column.
  • bright bool Set to true to signal that the bright state should be active. Bright is usually enabled for combos above BrightGhostComboThreshold.

Returns:

    nil
notefield:get_column_actors ()
Get the NoteColumnRenderers for each column. Using these, you can manipulate each individual column in the NoteField.

Returns:

    {NoteColumnRenderer,...} A table of NoteColumnRenderers starting from the left
notefield:show_beat_bars (state)
Toggle showing the beat bars in the NoteField board (behind the notes). Ordinarily, beat bars become visible if the metric ShowBeatBars is enabled. Setting this to true overrides that. Turning this off while the metric is turned on, however, does not force the bars off. The beat bars are typically visible for each measure, but can be more often depending on your metrics. See BarMeasureAlpha, Bar4thAlpha, Bar8thAlpha, Bar16thAlpha in metrics.

Parameters:

  • state bool True when you want the bars to be on.
notefield:show_interval_bars (state)
Toggle showing the interval bars in the NoteField board (behind the notes). The interval bars are simply bars that are aligned to each half second in time. Their use is to be aligned to the intervals of notes that are passed to the difficulty calculator, so they are not practical otherwise.

Parameters:

  • state bool True when you want the bars to be on.
generated by LDoc 1.5.0 Last updated 2024-10-02 05:06:53