background image wont show up
Posted: Thu Nov 17, 2022 1:29 am
I'm brand new to love, and I tried adding a background image to my project, and nothing showed. A little help?
Code: Select all
local items = {
"Gold bar",
"Dagger of the forest",
"Spirit Lock",
"Book of knowledge",
"Balloon dog",
"Tomato",
"Garbage bag",
"Digested gum",
"Lint Chunk",
"Potion of Strength",
"Walmart Shopping Cart"
}
local menu = love.audio.newSource("menu.mp3", "stream")
local ksong = love.audio.newSource("kenti village.mp3", "stream")
local swoovo = love.audio.newSource("swoovo.mp3", "stream")
local fsong = love.audio.newSource("peak's forest.mp3", "stream")
local inventory = {}
local coins = 0
local level = 1
local digit1 = 0
local digit2 = 0
local btforest = nil
local btkenti = false
local cttmarie = true
local zone = swoovo
swoovoday = love.graphics.newImage("swoovoback1.png")
swoovonight = love.graphics.newImage("swoovonight.png")
function background(image)
local scaleX = 200/image:getWidth() -- 200 and 100 from rectangle width and height
local scaleY = 100/image:getHeight() -- e.g. 100/200 -> scales by 0.5
love.graphics.draw(image, 0,0, 0, scaleX, scaleY)
end
function wait(seconds)
love.timer.sleep(seconds)
end
local function p(txt, x, y)
love.graphics.print(txt, x, y)
end
menu:play()
background(swoovoday)
p("Welcome to goofy tading", 250, 250)
wait(1)