Misc Questions

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Almost
Prole
Posts: 42
Joined: Fri Aug 21, 2009 8:04 pm
Location: Canada
Contact:

Misc Questions

Post by Almost »

Heya all!

Heh, just found the alt keys ö (148) and Ö (153). I now intend to use them every time I reference this engine.

I'm kinda new to Löve, but so far I'm finding it to be great. I've never touched Lua before, but I've got some coding experience already and so I've picked up most of it (I think).

There are, however, a couple of things about löve/lua that I'd like to do, but can't seem to find any way to and thus assume that they cannot be done. If any of these are possible, I'd appreciate being informed.

löve
-physics visualization, ie some way to access all bodies one after the other and draw them as the rectangle/circle that they are. This would be helpful in debugging, and could then be removed/disabled when not wanted
-draw image with tint/limited RGBA values (IE, have love.setColor() affect the RGBA of an image)
-resizable window (I can't seem to drag resize any windows for my löve games, and I'd like the user to be able to change it's dimensions in real time)
-change icon for games made in löve and/or .love files (both the icon next to the file in a file browser and the icon displayed in the topleft corner of the game window)
- reference a physics body from it's shape or vice versa (shape:setData() works alright, I guess)
- If I wanted to make a commercial/non-commercial game with Löve, I can use any license I want, so long as I do not claim to have created love, is this right? Also, if I make a standalone file (combine love.exe with mygame.love), must I also include the license.txt file that comes with löve?)

lua
-continue (you know, skip to next run of whatever loop is currently running. as far as I can tell there is no such command, which is kind of a nuisance)
-text editor with syntax highlighter and stuff for lua (gedit in ubuntu is great, but most of the time i only have windows available to me, and so end up using notepad/wordpad)

That's all that I can think of at the moment, Kudos to anyone who can help me out. (If you know that something I asked for cannot be done, please say so, so i don't spend too much more effort searching for it)
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Misc Questions

Post by Jasoco »

Bragging: On my Mac it's easier to do a Ö or ö because I don't have to remember numbers. Brag brag brag. :P :nyu:

I wish we could draw images tinted to a color too. Like removing all saturation to make them greyscale (Could be very useful) or colorize them with red if they are damaged, or blue if they're frozen, whatever. Colorized images would be awesome. If you ask me, it'd just be a third drawing mode on top of normal and modulate.

A resizable window would also be awesome since there could be a callback function onResize() or whatever that would be called when the window is changed size. In the Config file we'd have "Max Width", "Max Height" and "Min Width", "Min Height" values too to prevent making it too small or too big. (Optionally) The Zoom/Maximize buttons for each OS could resize it to the entire desktop's available width and heights and coding in a fullscreen key would allow you to switch it to full screen at the exact resolution of the monitor and prevent image stretching. The games would benefit greatly from the ability to resize in real time. Since not every game needs to have a fixed size.

The text editor is up to you. On OS X I use TextWrangler which has Lua syntax highlighting. And I'm sure Windows and Linux have their own text editors with Lua highlighting.

As I understand the licensing, you need to mention that the game was created with LÖVE. And provide a link to this site somewhere I guess. I mean look at a lot of games out there that use other engines, like games using the Unreal engine or the Havok engine. They simply mention the engine on the startup screens, and provide more license text in an About section somewhere.

Also: éøüßå∂∑œ†∂•ºƒ∂√µ≈åΩ≤≥÷≠¡™£¢∞§¶ç etc...
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Misc Questions

Post by TechnoCat »

Almost wrote:I'm kinda new to Löve, but so far I'm finding it to be great. I've never touched Lua before, but I've got some coding experience already and so I've picked up most of it (I think).
Welcome to LOVE! :megagrin:
Almost wrote:-draw image with tint/limited RGBA values (IE, have love.setColor() affect the RGBA of an image)
Set the mode to modulate first. Then you will get what you are expecting. love.graphics.setColorMode(love.color_modulate)
Almost wrote:-resizable window (I can't seem to drag resize any windows for my löve games, and I'd like the user to be able to change it's dimensions in real time)
As far as I know, this cannot be done with LOVE currently.
Almost wrote:-change icon for games made in löve and/or .love files (both the icon next to the file in a file browser and the icon displayed in the topleft corner of the game window)
I only know how to do this in Windows: Resource Hacker. http://angusj.com/resourcehacker/
Almost wrote:- If I wanted to make a commercial/non-commercial game with Löve, I can use any license I want, so long as I do not claim to have created love, is this right? Also, if I make a standalone file (combine love.exe with mygame.love), must I also include the license.txt file that comes with löve?)
http://love2d.org/license
Almost wrote:-text editor with syntax highlighter and stuff for lua (gedit in ubuntu is great, but most of the time i only have windows available to me, and so end up using notepad/wordpad)
http://net.tutsplus.com/articles/web-ro ... r-windows/
http://www.tripwiremagazine.com/tools/t ... opers.html
Almost wrote:That's all that I can think of at the moment, Kudos to anyone who can help me out. (If you know that something I asked for cannot be done, please say so, so i don't spend too much more effort searching for it)
Hey, no problem. Hope some of this helps. :monocle:

EDIT:
Jasoco wrote:Bragging: On my Mac it's easier to do a Ö or ö because I don't have to remember numbers. Brag brag brag. :P :nyu:
On Windows press ctrl+r and type 'charmap' for an extensive search-able list of all symbols of any font.
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: Misc Questions

Post by osgeld »

Almost wrote:Heya all!
hello!
Almost wrote: -resizable window (I can't seem to drag resize any windows for my löve games, and I'd like the user to be able to change it's dimensions in real time)
-change icon for games made in löve and/or .love files (both the icon next to the file in a file browser and the icon displayed in the topleft corner of the game window)
it can be faked to a degree
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Misc Questions

Post by Robin »

Almost wrote:Heya all!
Hello!
Almost wrote:-physics visualization, ie some way to access all bodies one after the other and draw them as the rectangle/circle that they are. This would be helpful in debugging, and could then be removed/disabled when not wanted
We had something like that in LovelyBigPlanet (a game created with LÖVE), albeit only for circles, and they did not rotate the way they should, and it was removed a while ago. But it's not in LÖVE, as others pointed out.
Almost wrote:-draw image with tint/limited RGBA values (IE, have love.setColor() affect the RGBA of an image)
The method described by TechnoCat works. LovelyBigPlanet uses that extensively.
Almost wrote:- reference a physics body from it's shape or vice versa (shape:setData() works alright, I guess)
You can always use a table with the bodies as keys and shapes as values, or the other way around.
Almost wrote:-continue (you know, skip to next run of whatever loop is currently running. as far as I can tell there is no such command, which is kind of a nuisance)
You're right. Both in that there is none, and that it's a nuisance. ;)
Almost wrote:-text editor with syntax highlighter and stuff for lua (gedit in ubuntu is great, but most of the time i only have windows available to me, and so end up using notepad/wordpad)
For Windows I use SciTE -- if you install stand-alone Lua for windows, you can choose to install SciTE plus a special theme, and all set up for writing lua.
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Misc Questions

Post by bartbes »

Continuing the endless quoting:
Jasoco wrote:[...]and coding in a fullscreen key would allow you to switch it to full screen at the exact resolution of the monitor and prevent image stretching.
Well, if you're good with combining love.graphics.setMode AND getMode you might be able to do that yourself.
Jasoco wrote:I wish we could draw images tinted to a color too. Like removing all saturation to make them greyscale (Could be very useful) or colorize them with red if they are damaged, or blue if they're frozen, whatever. Colorized images would be awesome. If you ask me, it'd just be a third drawing mode on top of normal and modulate
Wait, what?! That IS modulate. (though removing saturation isn't) Furthermore, this will be default in 0.6.0.
Almost wrote:Heya all!
Hi (following a trend here)
Almost wrote:-physics visualization, ie some way to access all bodies one after the other and draw them as the rectangle/circle that they are. This would be helpful in debugging, and could then be removed/disabled when not wanted
Possible to implement yourself. (though of course LÖVE lacks some features it's goal is not to provide everything, especially not things that can easily be done yourself)
Almost wrote:-continue (you know, skip to next run of whatever loop is currently running. as far as I can tell there is no such command, which is kind of a nuisance)
There is no such command, what is there to do about it? Change example 1 to example 2.

Code: Select all

--example 1
while true do
    if not_ready then
        continue
    end
    --some code
end

--example 2
while true do
    if ready then
        --some code
    end
end
Almost wrote:-text editor with syntax highlighter and stuff for lua (gedit in ubuntu is great, but most of the time i only have windows available to me, and so end up using notepad/wordpad)
I'd say SciTE, and, as Robin mentioned, the one with lua theme etc.
User avatar
Tenoch
Citizen
Posts: 76
Joined: Mon Jul 21, 2008 7:49 am

Re: Misc Questions

Post by Tenoch »

Jasoco wrote:Bragging: On my Mac it's easier to do a Ö or ö because I don't have to remember numbers. Brag brag brag. :P :nyu:
Bragging: on my keyboard, ö is a first level key, and Ö is shift + that key. Finnish keyboard FTW!

About the continue, a "classic" way to do it in Lua is to wrap the loop code in a "repeat until true":

Code: Select all

for i=0,9 do
 repeat
  -- use break here to skip to the next iteration
 until true
end
The break is caught by the "repeat until true" loop, which itself will execute only once. So it works, but you don't have a break for you first loop anymore.
"When in doubt, use brute force." Ken Thompson
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Misc Questions

Post by Robin »

Tenoch wrote:Bragging: on my keyboard, ö is a first level key, and Ö is shift + that key. Finnish keyboard FTW!
Well, I don't have a Finnish keyboard (or Mac, for that matter). But making an ö is as simple as typing "o (or Alt Gr + p), just like é is 'e, ñ is ~n (or Alt Gr + n)
Tenoch wrote:About the continue
I have another idea, I never used it or anything:

Code: Select all

function theLoop()
    -- loop code, return true for break, false for continue
end

for i=1,1000 do
    if theLoop() then break end
end
Help us help you: attach a .love.
User avatar
Almost
Prole
Posts: 42
Joined: Fri Aug 21, 2009 8:04 pm
Location: Canada
Contact:

Re: Misc Questions

Post by Almost »

TechnoCat wrote:Welcome to LOVE! :megagrin:
osgeld wrote:hello!
bartbes wrote:Hi (following a trend here)
Heh. Thanks for all the help everyone.
TechnoCat wrote: Set the mode to modulate first. Then you will get what you are expecting. love.graphics.setColorMode(love.color_modulate)
Yup, that's exactly what I wanted. (What else does modulate mode affect, or is it just images that are drawn?)
Whoa, nice list. I'm checking some of the items in it now, and a lot of them look to be really helpful.
TechnoCat wrote:On Windows press ctrl+r and type 'charmap' for an extensive search-able list of all symbols of any font.
Huh. I didn't know i could do that.. (windows+r though, not ctrl)
bartbes wrote:Continuing the endless quoting:
What quoting? ^^
bartbes wrote:
Almost wrote:-physics visualization, ie some way to access all bodies one after the other and draw them as the rectangle/circle that they are. This would be helpful in debugging, and could then be removed/disabled when not wanted
Possible to implement yourself. (though of course LÖVE lacks some features it's goal is not to provide everything, especially not things that can easily be done yourself)
Hmm, I guess I could make my own implementation should I need it.. my physics are working fine in my current project so I'll postpone that until I have more problems.
bartbes wrote:There is no such command, what is there to do about it? Change example 1 to example 2.

Code: Select all

--example 1
while true do
    if not_ready then
        continue
    end
    --some code
end

--example 2
while true do
    if ready then
        --some code
    end
end
yeah, that's more or less what I ended up doing, it just annoys me a bit more.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Misc Questions

Post by Jasoco »

A saturation option for images is what we need. And a way to colorize them. From what I've seen, Modulate just lets you remove each RGB value, but not change the hue or saturation or brightness. Would be nice to have that ability too. Being able to make things greyscale could work in a lot of games, either as a gimmick (Remember that Disney game with Mickey wandering through a gradually colorizing Steamboat Willy world that started off grey?) or as a feature. (Like when you pause, or go to a menu, or die, you could have the background fade to grey.)

love.graphics.setSaturation()
love.graphics.setHue()
love.graphics.setBrightness()

I've mentioned it before but I'd also like a blur option. So we could blur an entire rectangular/shaped area at once. Would be nice for making background layers out of focus, or even foreground layers.

love.graphics.setBlur(value, x, y, w, h)

Where value is a number in decimal from 0 to whatever like Photoshop would have. These days blurring is pretty much a built-in feature of most video cards. As is colorizing and desaturation.

åßç∂éƒ

So, what's the progress on 0.6.0? I'm eager to see what modifications I'm gonna have to make to get my game to work. (If my understanding is correct in that a lot of stuff has been changed)
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest