Search found 612 matches

by ReFreezed
Tue Mar 29, 2022 11:38 pm
Forum: Support and Development
Topic: [SOLVED] Executing commands after Return?
Replies: 5
Views: 2663

Re: Executing commands after Return?

To add to what BrotSagtMist said, values are optional in return statements in Lua and calls are the only things in Lua that can be both statements and expressions, thus the first print call here becomes part of the return statement. These examples don't work because the following statement is not a ...
by ReFreezed
Tue Mar 29, 2022 12:20 pm
Forum: Support and Development
Topic: Use love error handler back to back
Replies: 5
Views: 3412

Re: Use love error handler back to back

it works fine . . . at least once. (...) What I understand is that return love.run() is not a root reboot, but a reboot whithin love.errorhandler which is not recursive itself. So the end of program happens. The call to love.run() does not restart anything as far as LÖVE is concerned, and is not im...
by ReFreezed
Mon Mar 28, 2022 5:00 pm
Forum: General
Topic: [solved] example request , canvas scale - camera - pixel perfect - simplified
Replies: 21
Views: 14691

Re: example request , canvas scale - camera - pixel perfect - simplified

You're probably not too far off.

I've extended my initial example program with the concept of a world coordinate system, a movable player, and a camera that follows the player (in love.update). Also, screenToWorld and worldToScreen functions.
by ReFreezed
Mon Mar 28, 2022 7:44 am
Forum: Support and Development
Topic: Use love error handler back to back
Replies: 5
Views: 3412

Re: Use love error handler back to back

love.errorhandler is just supposed to be used for error reporting right before the game quits - not to restore or restart the state of the game. If you return a function (which the `return love.run()` line does) that function is supposed to just display the error. LÖVE doesn't expect the game to con...
by ReFreezed
Fri Mar 25, 2022 12:56 am
Forum: General
Topic: Game development analysis-paralysis
Replies: 6
Views: 3738

Re: Game development analysis-paralysis

Whenever I notice that what I'm writing is a bit sloppy or maybe belongs elsewhere, instead of fixing that issue right away I just add a "cleanup" comment and continue along. Sometimes I even intentionally write sloppy code with the intention of coming back later when I have a better under...
by ReFreezed
Thu Mar 24, 2022 11:13 am
Forum: Support and Development
Topic: release or nil for tables with images
Replies: 1
Views: 1684

Re: release or nil for tables with images

Setting animation to nil will release both the memory of the images and whatever memory Lua itself uses when the garbage collector runs, which could take a while before it happens. Calling :release() on the images first will immediately release the memory of the images (but the memory that Lua uses ...
by ReFreezed
Thu Mar 24, 2022 9:00 am
Forum: Support and Development
Topic: Having an issue with share dobject files.
Replies: 6
Views: 5504

Re: Having an issue with share dobject files.

Oh, yeah. That explains things. :d It looks like libTove.so isn't a Lua module, just a normal dynamic library, so that init.lua file is using ffi.load to load it instead of require(). Anyway, changing libPath to the correct path ought to solve the problem (i.e. point to love.filesystem.getSaveDirect...
by ReFreezed
Thu Mar 24, 2022 5:22 am
Forum: Support and Development
Topic: Having an issue with share dobject files.
Replies: 6
Views: 5504

Re: Having an issue with share dobject files.

Something like this: local contents = love.filesystem.read("thefile.so") -- Read from the .love file. love.filesystem.write("thecopy.so", contents) -- Write to save directory. local library = require("thecopy") -- Will try to load the module from the save directory, amo...
by ReFreezed
Thu Mar 24, 2022 1:57 am
Forum: Support and Development
Topic: [solved]Problem with fonts.
Replies: 2
Views: 1958

Re: Problem with fonts.

Looking at the stack traceback, the error is happening somewhere in newFont(). In the addCheckbox function, print all the arguments to see what they actually are - pfont must have the wrong value.
by ReFreezed
Wed Mar 23, 2022 10:44 am
Forum: Support and Development
Topic: File not found, but it's exist
Replies: 20
Views: 9068

Re: File not found, but it's exist

well, thanks, it worked! now i need to stream the video using videostream because it's just showing me a black screen. Using a VideoStream object anywhere makes no difference (see the reply below). The issue is elsewhere. You'll have to describe what exactly you're doing (with code) and what you've...