Skip to content

Commit

Permalink
feat: watermark
Browse files Browse the repository at this point in the history
  • Loading branch information
qixils committed Aug 10, 2023
1 parent ee249b2 commit 3ab16fb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 36 deletions.
10 changes: 10 additions & 0 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,16 @@ function properprint(s, x, y)
end
end

function borderprint(s, x, y, textcolor, bordercolor)
local positions = {{-scale, scale}, {scale, scale}, {-scale, -scale}, {scale, -scale}, {0, -scale}, {0, scale}, {scale, 0}, {-scale, 0}, {0, 0}}
local color = bordercolor or {0, 0, 0}
for i, position in ipairs(positions) do
if i == #positions then color = textcolor or {1, 1, 1} end
love.graphics.setColor(color)
properprint(s, x+position[1], y+position[2])
end
end

function loadcustombackground()
local i = 1
custombackgroundimg = {}
Expand Down
47 changes: 11 additions & 36 deletions menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,51 +293,26 @@ function menu_draw()
love.graphics.draw(menuselection, 98*scale, (137+(selection-1)*16)*scale, 0, scale, scale)
end

local start = 9
local printfunction = properprint
if custombackground then
start = 1
printfunction = borderprint
end

for i = start, 9 do
local tx, ty = -scale, scale
love.graphics.setColor(0, 0, 0)
if i == 2 then
tx, ty = scale, scale
elseif i == 3 then
tx, ty = -scale, -scale
elseif i == 4 then
tx, ty = scale, -scale
elseif i == 5 then
tx, ty = 0, -scale
elseif i == 6 then
tx, ty = 0, scale
elseif i == 7 then
tx, ty = scale, 0
elseif i == 8 then
tx, ty = -scale, 0
elseif i == 9 then
tx, ty = 0, 0
love.graphics.setColor(1, 1, 1)
end

love.graphics.translate(tx, ty)

if continueavailable then
properprint("continue game", 87*scale, 122*scale)
end
if continueavailable then
printfunction("continue game", 87*scale, 122*scale)
end

properprint("player game", 103*scale, 138*scale)
printfunction("player game", 103*scale, 138*scale)

properprint("level editor", 95*scale, 154*scale)
printfunction("level editor", 95*scale, 154*scale)

properprint("select mappack", 87*scale, 170*scale)
printfunction("select mappack", 87*scale, 170*scale)

properprint("options", 111*scale, 186*scale)
printfunction("options", 111*scale, 186*scale)

properprint(players, 87*scale, 138*scale)
printfunction(players, 87*scale, 138*scale)

love.graphics.translate(-tx, -ty)
end
borderprint("speedrun mod by lexi", 234*scale, 208*scale)

if players > 1 then
love.graphics.draw(playerselectimg, 82*scale, 138*scale, 0, scale, scale)
Expand Down

0 comments on commit 3ab16fb

Please sign in to comment.