Files
itgmania212121/Docs/Themerdocs/Examples/Example_Actors/RollingNumbers.lua
T
2015-02-05 19:34:00 -05:00

39 lines
1.5 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- A simple RollingNumbers example, which takes 10 seconds to go from 0 to 1000.
-- RollingNumbers are interesting (and kind of lame) in the sense that
-- the way they are loaded is through metrics.
-- To test this, put this in your metrics ini:
[RollingNumbersExample]
Fallback=RollingNumbers
TextFormat=%04.0f
ApproachSeconds=10
Commify=true
LeadingZeroMultiplyColor=Color.Orange
-- Be sure to reload the metrics if StepMania is currently open.
-- Lets go over the parts:
-- TextFormat: How many trailing zeroes you want, using the format “xx.0f”, where xx
-- is the number.
-- ApproachSeconds: How many seconds it takes to reach the target number (explained later)
-- Commify: Whether or not to use commas every 3 digits, i.e. 1,000 vs 1000.
-- Commify can only be true or false.
-- LeadingZeroMultiplyColor: The color of the closest zero to the number.
-- For example, if you were to make LeadingZeroMultiplyColor red, and
-- your RollingNumber was at 100 with a TextFormat of “%04.0f”, then
-- then the zero before the 1 (0100) would be red.
-- Now, for the actual thing:
Def.RollingNumbers{
-- RollingNumbers derives from BitmapText, so youre gonna need a font.
Font=Common Normal,
-- Text is unnecessary however, and may break the game.
-- Lets load the metrics and set our target number
OnCommand=cmd(Load,RollingNumbersExample;targetnumber,1000)
}
-- Your RollingNumber should start at zero, then take 10 seconds to reach 1000.