Lua 背景色为LÖ;VE
我已经设置了一个配置文件,我刚刚开始编写一个程序来设置一个基于文本的RPG/模拟游戏的标题屏幕。 背景色似乎没有改变默认的黑色,这有点问题。我已经在下面发布了我的现有代码。是的,我正在执行包含配置文件和代码的整个文件夹Lua 背景色为LÖ;VE,lua,love2d,Lua,Love2d,我已经设置了一个配置文件,我刚刚开始编写一个程序来设置一个基于文本的RPG/模拟游戏的标题屏幕。 背景色似乎没有改变默认的黑色,这有点问题。我已经在下面发布了我的现有代码。是的,我正在执行包含配置文件和代码的整个文件夹 function love.load() love.graphics.setBackgroundColor( 255, 255, 255 ) end function love.update(dt) end function love.graphics.ne
function love.load()
love.graphics.setBackgroundColor( 255, 255, 255 )
end
function love.update(dt)
end
function
love.graphics.newImage (\LUA txt adventure\Title.png)
end
$
您使用的是哪个版本的框架?我使用的是LÖVE@legends2k的0.9.2版本。我在0.10.1上使用了
test
文件夹,该文件夹有一个main.lua
只包含函数love.load()love.graphics.setBackgroundColor(255,255,0)end
,它用黄色清除了屏幕。根据,如果您正确设置背景颜色,则应自动为您进行清除;检查您是否设置正确。@legends2k我不确定我做了什么,但我让它工作了,它一定是LUA文件的名称或LOVE的版本,我更新了两者,现在它工作了,谢谢您的帮助。您使用的是哪个版本的框架?我使用的是LÖVE的0.9.2版本,@legends2k.我在0.10.1上用一个test
文件夹尝试了它,它有一个main.lua
文件夹,其中只包含函数love.load()love.graphics.setBackgroundColor(255,255,0)end
,它用黄色清除了屏幕。根据,如果您正确设置背景颜色,则应自动为您进行清除;检查设置是否正确。@legends2k我不确定我做了什么,但我让它工作了,它一定是LUA文件的名称或LOVE的版本,我更新了两者,现在它工作了,谢谢你的帮助。
function love.conf(t)
t.modules.joystick = true -- Enable the joystick module (boolean)
t.modules.audio = false -- Enable the audio module (boolean)
t.modules.keyboard = true -- Enable the keyboard module (boolean)
t.modules.event = true -- Enable the event module (boolean)
t.modules.image = true -- Enable the image module (boolean)
t.modules.graphics = true -- Enable the graphics module (boolean)
t.modules.timer = true -- Enable the timer module (boolean)
t.modules.mouse = true -- Enable the mouse module (boolean)
t.modules.sound = false -- Enable the sound module (boolean)
t.modules.thread = true
t.modules.physics = true -- Enable the physics module (boolean)
t.console = false -- Attach a console (boolean, Windows only)
t.title = "Space Trade Sim" -- The title of the window the game is in (string)
t.author = "Magikarp" -- The author of the game (string)
t.window.fullscreen = false -- Enable fullwindow (boolean)
t.window.vsync = false -- Enable vertical sync (boolean)
t.window.fsaa = 0 -- The number of FSAA-buffers (number)
t.window.height = 600 -- The window height (number)
t.window.width = 800 -- The window width (number)
end