Search found 3073 matches
- Tue Nov 11, 2014 7:31 pm
- Forum: Support and Development
- Topic: Palette swap
- Replies: 4
- Views: 2950
Re: Palette swap
Unfortunately i have had very little experience with shaders as of yet, but i think that they could be of use to you in this regard. consider your enemy sprites having a set number of unique colors (rgb triplets), let's say 16. Then, you make a fragment shader (working on pixels) that gets an extern...
- Tue Nov 11, 2014 7:25 pm
- Forum: Support and Development
- Topic: "Questions that don't deserve their own thread" thread
- Replies: 905
- Views: 214926
Re: "Questions that don't deserve their own thread" thread
Use love.graphics.setColor( r, g, b ), you will have to call this function before you change the color of something. He asked about the background color of a text, which you can't set by default, but you can write a quick and dirty wrapper: (untested, but should work) function drawBgText(text,x,y,f...
- Tue Nov 11, 2014 7:21 am
- Forum: General
- Topic: Check if an element already exists in a table
- Replies: 18
- Views: 5410
Re: Check if an element already exists in a table
The problem is that they are separately defined tables.
It will return true if you do:
Code: Select all
{"untitled"} ~= {"untitled"}
Code: Select all
game = {}
local a = {"untitled"}
game[a] = true
print(game[a])
- Mon Nov 10, 2014 4:20 am
- Forum: Support and Development
- Topic: Table Problems Is it Lua JIT?
- Replies: 5
- Views: 2068
Re: Table Problems Is it Lua JIT?
That tutorial is mixing the C api part with the lua part in, as far as i see it. (since it assumes you writing the c part of your code as well; with love, that's a bit moot) And if you want callback functions in lua , then you do it the usual way: function callback(params) --... end -- or callback =...
- Sun Nov 09, 2014 7:42 am
- Forum: Support and Development
- Topic: Table Problems Is it Lua JIT?
- Replies: 5
- Views: 2068
Re: Table Problems Is it Lua JIT?
you only need to use commas (,) if you put your members into the table definition, not do it externally. Let me show you what i mean: Table = { v1 = 5, v2 = 'h', -- etc... } vs. Table = {} v1 = 5 v2 = 'h' -- etc Basically, to the parser, it seemed that you tried to do screen.x = 4, screen.y so it tr...
- Sat Nov 08, 2014 2:25 pm
- Forum: General
- Topic: Noob help, can't run .lua file
- Replies: 10
- Views: 4683
Re: Noob help, can't run .lua file
The reason is that reasonably, most reasonable OSes have unzipping utilities installed by default, whereas rar is (i think) proprietary (the compressor part at least, but still, some os-es don't give you unrar out-of-the-box), and 7z needs its own decompressor that's not included on most OS-es by de...
- Fri Nov 07, 2014 1:34 pm
- Forum: General
- Topic: Show off clean code examples
- Replies: 13
- Views: 3566
Re: Show off clean code examples
they are both false in a sense, but you can indeed test explicitly if the return value is nil, or not (Rudimentary ternary logic ftw
)

- Fri Nov 07, 2014 5:35 am
- Forum: General
- Topic: Noob help, can't run .lua file
- Replies: 10
- Views: 4683
Re: Noob help, can't run .lua file
It does support plain ZIPs as well.
- Thu Nov 06, 2014 8:44 pm
- Forum: Support and Development
- Topic: Run pure lua programs
- Replies: 6
- Views: 2857
Re: Run pure lua programs
agreed, i did not actually state that he should set console to false, just that i wasn't sure whether window was needed for the console window or not; guess not then! 

- Wed Nov 05, 2014 11:19 pm
- Forum: Support and Development
- Topic: Run pure lua programs
- Replies: 6
- Views: 2857
Re: Run pure lua programs
or you could do t.window = false in your conf, so it's not even initialized... OR even better, just set the window module to false, so it's not even loaded. (i -think- it's not needed for a console on win, and on other OSes, it interfaces with the proper console anyway)