begin function for drawing title screen

This commit is contained in:
2025-02-19 04:07:27 +00:00
parent 6ca2d379f7
commit dab81e3904
4 changed files with 39 additions and 5 deletions

23
fcore/title/title-vec.sml Normal file
View File

@@ -0,0 +1,23 @@
structure TitleVec =
struct
val fontSpace = Constants.fontSpace
val fontSize = Constants.fontSize
fun getTextVec (x, y, windowWidth, windowHeight, pos, str, acc) =
if pos = String.size str then
Vector.concat acc
else
let
val chr = String.sub (str, pos)
val chrFun = Vector.sub (CozetteAscii.asciiTable, Char.ord chr)
val hd = chrFun
(x, y, fontSize, fontSize, windowWidth, windowHeight, 0.0, 0.0, 0.0)
val acc = hd :: acc
in
getTextVec
(x + fontSpace, y, windowWidth, windowHeight, pos + 1, str, acc)
end
fun getDrawVec (title: TitleType.title_type, width, height) =
getTextVec (555, 55, width, height, 0, "hello world", [])
end