summaryrefslogtreecommitdiff
path: root/print_good.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2025-11-02 20:12:27 +0000
committerubq323 <ubq323@ubq323.website>2025-11-02 20:12:27 +0000
commit47ffcf781e29fbc02b51365d2c4332fe97eba694 (patch)
treea64c410a91420e7d9cea10db04d886e7c0141501 /print_good.lua
parentf238f1637d53389e4e804de72b7789c8fe312433 (diff)
change print_good greatly, to be fixed properly later
Diffstat (limited to 'print_good.lua')
-rw-r--r--print_good.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/print_good.lua b/print_good.lua
index 60948bb..f348a30 100644
--- a/print_good.lua
+++ b/print_good.lua
@@ -1,8 +1,10 @@
-local font = love.graphics.getFont()
+local font = love.graphics.newFont(18)
local text = love.graphics.newText(font)
-local function print_good(str,x,y)
- text:setFont(love.graphics.getFont())
+local function print_good(str,x,y,othrfont,nob)
+ love.graphics.push()
+ love.graphics.origin()
+ text:setFont(othrfont or font)
text:set(str)
local w,h = text:getDimensions()
local W,H = love.graphics.getDimensions()
@@ -11,9 +13,10 @@ local function print_good(str,x,y)
if x == "end" then x = W-w end
if y == "end" then y = H-h end
love.graphics.setColor(0,0,0,0.8)
- love.graphics.rectangle("fill",x,y,w,h)
- love.graphics.setColor(1,1,1)
+ if not nob then love.graphics.rectangle("fill",x,y,w,h) end
+ love.graphics.setColor(not nob and {1,1,1} or {0,0,0})
love.graphics.draw(text,x,y)
+ love.graphics.pop()
end
return print_good