diff options
Diffstat (limited to 'src/LivingVillage.Desktop/TitleScreen.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/TitleScreen.fs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/LivingVillage.Desktop/TitleScreen.fs b/src/LivingVillage.Desktop/TitleScreen.fs index 00cf5b8..7ec46d2 100644 --- a/src/LivingVillage.Desktop/TitleScreen.fs +++ b/src/LivingVillage.Desktop/TitleScreen.fs @@ -29,7 +29,12 @@ module TitleScreen = FirstItemY: int CursorX: int CursorWidth: int - TextX: int } + TextX: int + ControlsPanelY: int + ControlsRowHeight: int + ControlsKeyX: int + ControlsKeyWidth: int + ControlsActionX: int } type TextRect = { X: int @@ -43,6 +48,13 @@ module TitleScreen = || a.Y + a.Height <= b.Y || b.Y + b.Height <= a.Y + /// Key-name and action rectangles for one controls-page row. The key column has a + /// fixed width shared by every row, so all action texts start on the same x. + let controlRowRects (layout: TitleLayout) (rowIndex: int) : TextRect * TextRect = + let y = layout.FirstItemY + rowIndex * layout.ControlsRowHeight + { X = layout.ControlsKeyX; Y = y; Width = layout.ControlsKeyWidth; Height = 16 }, + { X = layout.ControlsActionX; Y = y; Width = layout.PanelX + layout.PanelWidth - layout.ControlsActionX - 24; Height = 16 } + /// Cursor and label rectangles for one menu row. The cursor is drawn in its own /// column; the label always starts to the right of it, so they can never overprint. let selectionRects (layout: TitleLayout) (rowIndex: int) : TextRect * TextRect = @@ -111,4 +123,9 @@ module TitleScreen = FirstItemY = height / 2 - 64 + 60 CursorX = (width - panelWidth) / 2 + 24 CursorWidth = 20 - TextX = (width - panelWidth) / 2 + 24 + 20 + 12 } + TextX = (width - panelWidth) / 2 + 24 + 20 + 12 + ControlsPanelY = max 16 (height - 480) + ControlsRowHeight = 25 + ControlsKeyX = (width - panelWidth) / 2 + 24 + ControlsKeyWidth = 120 + ControlsActionX = (width - panelWidth) / 2 + 24 + 120 + 12 } |
