MusicWheel
From SMTheming Wiki
MusicWheel is a type of Wheel. Specifically, it deals with Songs and Courses (MusicWheelItems), and can be found in ScreenSelectMusic.
Contents |
Usage
The MusicWheel has changed a lot between StepMania 3.9 and StepMania 4.
Common
These metrics are shared between StepMania versions:
Settings
| Name | Value Type | Description |
|---|---|---|
SwitchSeconds
| float | How fast the wheel should switch between items for a single press. (Hold speed is controlled by a preference.) |
RouletteSwitchSeconds
| float | How fast the roulette should switch in full-speed. |
RouletteSlowDownSwitches
| int | How many times should the roulette slow down before settling. |
NumWheelItems
| int | Define how many items should be shown on the wheel. |
MostPlayedSongsToShow
| int | Define how many items should be shown in Player's Best/Popularity sort. |
ShowRoulette
| bool (SM3.9: 0/1, SM4: false/true)
| Toggles display of Roulette item. |
ShowRandom
| bool | Toggles display of Random item. |
ShowPortal
| bool | Toggles display of Portal. |
ScrollBar
| Name | Value Type | Description |
|---|---|---|
ScrollBarX
| float | The position of the ScrollBar, relative to the MusicWheel. (StepMania 4: Set this in ScrollBarOnCommand; e.g. ScrollBarOnCommand=x,120)
|
ScrollBarHeight
| float | How tall the scrollbar should be. |
Colors
- See also: SongManager
| Name | Value Type | Description |
|---|---|---|
NumSectionColors
| int | Defines how many SectionColors there are. |
SectionColor*
| color | Where * is a number from 1-NumSectionColors.
|
SongRealExtraColor
| color | Defines the color of an Extra Stage song. |
SortMenuColor
| color | Defines the color of the sort menu. |
StepMania 3.9-only
| Name | Value Type | Description |
|---|---|---|
FadeSeconds
| float | ? |
LockedInitialVelocity
| float | ? |
UseExtraColor
| bool | (Only in StepMania 3.9 Plus/Plus Redux.) |
ExtraColorOverridesMenuColor
| bool | (Only in StepMania 3.9 Plus/Plus Redux.) |
Item Delays
StepMania 3.9 gradually tweens each wheel item in and out.
| Name | Value Type | Description |
|---|---|---|
WheelItemOnDelayCenter
| float | |
WheelItemOnDelayOffset
| float | |
WheelItemOffDelayCenter
| float | |
WheelItemOffDelayOffset
| float |
Transform
These metrics define how the wheel items are positioned.
| Name | Value Type | Description |
|---|---|---|
ItemCurveX
| float | Define how much the items should curve. |
ItemSpacingY
| float | Define the spacing between wheel items. |
NoCurving
| bool | If set to 1, the wheel will be linear instead of curved.
|
Use3D
| bool | If set to 1, the wheel will be displayed in 3D.
|
Wheel3DRadius
| float | Defines the radius of the wheel. (Only used if Use3D=1.)
|
CirclePercent
| float | Define how much of a circle the wheel should be. (Only used if Use3D=1; Intended values are 0-1.)
|
StepMania 5.0-only
- StepMania 5 includes sm-ssc and StepMania 4 alpha 5. StepMania 4 uses most of the old 3.9 methods (except using true/false instead of 1/0 for bools, and strings need to be quoted).
| Name | Value Type | Description |
|---|---|---|
RandomPicksLockedSongs
| bool | Defines if Random should pick locked songs. |
UseEasyMarkerFlag
| bool | Defines if the easy marker should be used. (Also available in StepMania 3.9 Plus/Plus Redux)
|
Transform
Instead of various metrics, the MusicWheel Transform in StepMania 5 is represented as a Lua function.
An example function (using \ at the end of the line for readability; SM5 can run this code):
ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) \ self:x( (1-math.cos(offsetFromCenter/math.pi))*44 ); \ self:y( offsetFromCenter*38 ); \ end
self:y() is similar to the ItemSpacingY metric, while the self:x() command shown here is similar to the ItemCurveX metric. For a linear wheel (NoCurve=1), you can remove the self:x() line, or modify it to be similar to the self:y() line.
If your transform function is a bit complex, you may want to consider moving it to a file in the Scripts folder. This brings the downside of the function not being easily reloaded (unless you use Ctrl+F2 in sm-ssc/SM5).
When using the itemIndex and numItems variables in the transform, you may notice that the values they give are not accurate. The reason for this can be found in WheelBase::SetItemPosition:
/* Don't supply and item index or num items. The number of items can be so * large that transforms that depend on such large numbers are likely to break. */ int iItemIndex = 0; // dummy int iNumItems = 1; // dummy
It is recommended that you grab the number of items from the metrics, via THEME:GetMetric("MusicWheel","NumWheelItems").
Metrics.ini
ItemTransformFunction=MusicWheelTransform(self,offsetFromCenter,itemIndex,numItems) end
Scripts/wherever.lua
function MusicWheelTransform(self,offsetFromCenter,itemIndex,numItems) self:x(offsetFromCenter*16); self:y(offsetFromCenter*40); self:rotationy(offsetFromCenter*15); end;

