Search found 234 matches
- Mon Jul 31, 2017 7:43 pm
- Forum: Support and Development
- Topic: Use require function.
- Replies: 6
- Views: 6658
Re: Use require function.
The general thing to do is return a local table from another file and place into a variable. main.lua local myRequiredTable = require 'otherfile' function love.load() myRequiredTable.printStuff() end otherfile.lua local myLocalTable= { a = 1, b = 2, c = 3 } function myLocalTable.printStuff() print(m...
- Sun Jul 02, 2017 1:45 am
- Forum: Libraries and Tools
- Topic: Simplify - simple Event-driven GUI library
- Replies: 5
- Views: 5598
Re: Simplify - simple Event-driven GUI library
Not too shabby, athough I do want to point out one thing... In lines 99-106 of 'Simplify.lua' you overwrite the Love callbacks... While not too much of an issue for a personal project, doing so in a library you're releasing to the public is another story. That said, what you should do is either docu...
- Thu Jun 29, 2017 6:41 pm
- Forum: Libraries and Tools
- Topic: [lib] CTRL - input handling
- Replies: 12
- Views: 18471
Re: [lib] CTRL - input handling
Looks nice and polished, I'll definitely be giving it a try. Keep up the good work!
- Tue Jun 20, 2017 6:49 pm
- Forum: Support and Development
- Topic: Help (Need Help For My Module)
- Replies: 14
- Views: 8541
Re: Help (Need Help For My Module)
In your object's update you are just overwriting globals, not changing per entity variables... Also, when using semicolon syntax the first parameter passed is self. Object.update(Object, dt) == Object:update(dt) function Object:draw() love.graphics.rectangle('fill', self.x, self.y, self.w, self.h) e...
- Tue Jun 20, 2017 6:25 pm
- Forum: Support and Development
- Topic: How are circles drawn? (source link pls)
- Replies: 6
- Views: 4371
- Fri Jun 09, 2017 6:52 pm
- Forum: Games and Creations
- Topic: Cactus game.
- Replies: 37
- Views: 34062
- Thu May 25, 2017 4:31 pm
- Forum: Support and Development
- Topic: Odd Require Path Problems
- Replies: 5
- Views: 4670
Re: Odd Require Path Problems
Below is an excerpt from the game template I use... Keep in mind I didn't trim it down so you'd have to edit to suit, but here it is nonetheless. What happens is I pass a folder to dbug.enumFiles which selects based on lib boolean, sends to requireFiles , and pcall requires everything and returns as...
- Mon May 22, 2017 3:02 pm
- Forum: Support and Development
- Topic: [SOLVED] Help with custom settings / save files?
- Replies: 7
- Views: 7032
Re: Help with custom settings / save files?
I asked a similar question a while back... Here is the response to it.
- Sat May 20, 2017 9:45 pm
- Forum: Support and Development
- Topic: How to use function love.keyreleased(key) in another lua file
- Replies: 4
- Views: 3953
Re: How to use function love.keyreleased(key) in another lua file
Do you mean use the same function in multiple files? You could: Require the file once, and have that file create global variables. Require the file once, and return as a global variable. Require the file in every other file that needs it, and return a local variable. Also when including code on a fo...
- Wed Apr 26, 2017 2:03 pm
- Forum: Support and Development
- Topic: Need help for my loader...
- Replies: 6
- Views: 4755
Re: Need help for my loader...
Require is not a magic word, it is a function. With functions as long as you only have one argument and it's a string, then you do not need parenthesis. If you use a variable or concatenate a string, you'll need to enclose it.