Page 2 of 2

Re: please help make an options menu!

Posted: Fri Oct 05, 2012 3:21 pm
by paritybit
Roland_Yonaba wrote: I really like this one. Good job!
Thanks!
Roland_Yonaba wrote: Well, just change line 33 in main.lua:
Thanks, I knew I was being stupid somehow. I just didn't realize how stupid until you pointed it out. Just too tired to see it.

Your suggestions are good, and I agree. For the selected item, I had already taken the fade to another color code from the snippets and plopped it into my color class so that I could do something -- I just haven't done it yet. And I'm definitely trying to figure out the best way to 'animate' transitions; your suggestion will help out a lot as I didn't even know what 'tweening' was -- I've been meaning to look it up every time I see it but you finally made me do it (by accident).

Re: please help make an options menu!

Posted: Fri Oct 05, 2012 4:05 pm
by qaisjp
You shouldn't store like
"set bla val
bla val
" It is inefficient, just store a table.

Nice options menu, paritybit, perhaps keep an interface for mouse interaction too? This means creating a slider scrollbar.
In another Lua framework I have a useful XMB style menu coded in Lua, once I have finished converting my code (my mathematical friend and I created that code for one of my servers) to LOVE I'll release the [long] snippet out.

Re: please help make an options menu!

Posted: Fri Oct 05, 2012 4:47 pm
by Roland_Yonaba
paritybit wrote: Your suggestions are good, and I agree. For the selected item, I had already taken the fade to another color code from the snippets and plopped it into my color class so that I could do something -- I just haven't done it yet. And I'm definitely trying to figure out the best way to 'animate' transitions; your suggestion will help out a lot as I didn't even know what 'tweening' was -- I've been meaning to look it up every time I see it but you finally made me do it (by accident).
Great.
Let us know if you come up with something.
Easing won't be that hard to implemented. Hopefully, kikito's made a great wrapper around easing functions (Tween interface) that handles the most complicated part.

Re: please help make an options menu!

Posted: Sat Oct 06, 2012 10:32 pm
by walia6
Thanks everyone! I got it.

But Just wondering how do i change the full screen resolution? like in snayke the love2d game.
I dont wanna do the menu now. just wanna do that in conf.lua

Re: please help make an options menu!

Posted: Sun Oct 07, 2012 4:11 am
by paritybit
walia6 wrote:But Just wondering how do i change the full screen resolution?

...

just wanna do that in conf.lua
The conf.lua wiki page has all the information you need.

You need to add this to your conf.lua (somewhere among all the other stuff):

Code: Select all

function love.conf(t)
    t.screen.fullscreen = true
end

Re: please help make an options menu!

Posted: Sun Oct 07, 2012 9:33 am
by Roland_Yonaba
paritybit wrote:

Code: Select all

function love.conf(t)
    t.screen.fullscreen = true
end
Hmm, not sure that was what he was asking for.
He didn't mean how to "enable fullscreen", but how to "work with a specific resolution being in fullscreen mode"...?
I think that love.graphics.setMode is what you're looking for.

Example:

Code: Select all

function love.load()
  winr = {800,600} -- windowed resolution
  fsr = {480,272} -- fullscreen resolution
end

function love.draw()
  love.graphics.print(('W: %d, H: %d'):format(love.graphics.getWidth(), love.graphics.getHeight()),10,10)
end

function love.keypressed(key,u)
  if key =='r' then
    love.graphics.setMode(fsr[1],fsr[2],true,false,0)
  elseif key == 'w' then
    love.graphics.setMode(winr[1],winr[2],false,false,0)
  end
end