Accessing config information
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Accessing config information
Other than the screen dimensions, which can be reached via the love.graphics module, is there any way to access the information set in conf.lua inside the rest of the code? For example, accessing the title and author information, or whether the game is in Release Mode or not.
Re: Accessing config information
You're having it hard-coded anyway, why not duplicate it into your target file?
Re: Accessing config information
Because I'm curious if there is a way or not.
Re: Accessing config information
I would guess it's stored somewhere in love. If you're interested in the stuff in the actual conf.lua file, you could always just call love.conf() again and read it from the table you passed into it. But not sure you'd get your hands on the table with the default values.
Re: Accessing config information
I'm assuming you mean:
That certainly seems hackish. I ran a for loop through the love module to see if it was somewhere in the top level, but I didn't notice anything. I'm assuming that they don't want you to be able to change the window title mid game, or flip from debug to release mode on the fly.
Code: Select all
-- main.lua
local properties = {}
function love.conf(t)
-- Set values
properties = t
end
--...
Re: Accessing config information
I don't think changing those informations, even if you found them, would actually do anything; anyway, love.graphics.setCaptionMarekkPie wrote:I'm assuming you mean:
That certainly seems hackish. I ran a for loop through the love module to see if it was somewhere in the top level, but I didn't notice anything. I'm assuming that they don't want you to be able to change the window title mid game, or flip from debug to release mode on the fly.Code: Select all
-- main.lua local properties = {} function love.conf(t) -- Set values properties = t end --...
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Accessing config information
I'm looking more to get that information rather than set it, so the hack I described could work. However, it looks like they are implementing an additional module for some of that information, love.window, for version 0.9.0. There still doesn't seem to be anything that can tell whether an application is in release mode or not, beyond the above hack.
Re: Accessing config information
As long as Löve itself does no trickery (which to my knowledge it doesn't) you should be able to open up the conf.lua file and read it yourself.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests