Skip to content

Modcharts

AlsoGhostglowDev edited this page Feb 9, 2024 · 2 revisions
local mdc = require "ghostutil.Modcharts"

For eases, check out FlxEase

Functions

downscroll(note:Int, toggle:Bool, duration:Float, ?ease:String, ?withUi:Bool, ?modchartTag:String) -> Void

Transitions to downscroll

  • note: 0 to 3 are opponent's notes respectively, 4 to 7 is player's notes respectively
  • toggle: A boolean, do you want to toggle downscroll on or off? (Note: If the user is using downscroll, it will transition to upscroll. If the user is using upscroll only then it will transition to downscroll)
  • duration: The duration for it to finish (in seconds)
  • ease: FlxEase
  • withUi: Do you want the other UI to also be in their downscroll positions (exclude the custom hud elements)
  • modchartTag: A tag used for the function onModchart (Default: "ModchartDownscroll")

Example:

for i = 0,7 do
    mdc.downscroll(i, true, 3, "smootherStepInOut", true, "downscrollTag")
end

function onModchart(tag)
    if tag == "downscrollTag" then
        debugPrint "Going downscroll."
    end
end

middlescroll(toggle:Bool, opponentVisible:Bool, duration:Float, ?ease:String, ?modchartTag:String) -> Void

Transitions to middlescroll

  • toggle: Middlescroll or nah?
  • opponentVisible: Do you want the opponent's notes to be in their respective middlescroll positions or fade away?
  • duration: The time it takes to complete
  • ease: FlxEase
  • modchartTag: A tag used for the function onModchart (Default: "ModchartMiddlescroll")

Example:

mdc.middlescroll(true, true, 1.7, "expoOut", "middle")

function onModchart(tag)
    if tag == "middle" then
        debugPrint "Going middlescroll."
    end
end

swapStrums(toggle:Bool, duration:Float, ?ease:String, ?modchartTag:String) -> Void

Swaps the player's and opponent's strums

  • toggle: True is swap and false is unswap / normal
  • duration: The duration for it to finish
  • ease: FlxEase
  • modchartTag: A tag used for the function onModchart (Default: "ModchartSwapStrums")

Example:

mdc.swapStrums(true, 1.7, "expoOut", "swapper")

function onModchart(tag)
    if tag == "swapper" then
        debugPrint "Swappin' strums"
    end
end
Clone this wiki locally