Search found 1552 matches

by pgimeno
Fri Mar 15, 2019 12:00 am
Forum: General
Topic: Putting Objects Into Strings
Replies: 5
Views: 378

Re: Putting Objects Into Strings

After rereading the post, I think that the question isn't how to make sure that every object contains a tostring method so that all objects can be (manually) serialized, as I understood initially, but how to make sure that you never add a field to any object that can't be serialized (i.e. is userdat...
by pgimeno
Thu Mar 14, 2019 2:55 pm
Forum: Games and Creations
Topic: Get mouse coordinates on a rotated "grid"
Replies: 10
Views: 1066

Re: Get mouse coordinates on a rotated "grid"

Have you tried https://love2d.org/wiki/love.graphics.inverseTransformPoint ? Yeah but this may be off by 1 frame if used within love.update anywhere but in love.draw. Edit: And that's the best case. Actually the problems may be worse. It won't work unless that's the last transformation in love.draw...
by pgimeno
Thu Mar 14, 2019 1:42 am
Forum: General
Topic: Putting Objects Into Strings
Replies: 5
Views: 378

Re: Putting Objects Into Strings

The solution seems so simple that I've probably misunderstood something. Since you're creating a class specifically for that, you can add a mandatory parameter to your class creation function: the tostring function to use with the class.

What am I missing?
by pgimeno
Wed Mar 13, 2019 10:37 am
Forum: Support and Development
Topic: How i can permanently ban someone by their ip from the server? [SOLVED]
Replies: 17
Views: 1592

Re: How i can permanently ban someone by their ip from the server? [SOLVED]

Technically im not going to host any server, i want to make a totally hackable server for the community, Look at all these Minecraft™ mods! Mojang™ is just offering the game and Microsoft™ invented Realms™ (but are expensive (compared to homemade) and Microsoft™ is just forcing everyone to use that...
by pgimeno
Mon Mar 11, 2019 11:37 am
Forum: Support and Development
Topic: Quads Rotates
Replies: 0
Views: 466

Re: Quads Rotates

I'm not sure I understand where you're having trouble, but just in case, here's a simple demo that rotates a quad of an image (at a speed that depends on the frame rate, for simplicity). -- Image: https://opengameart.org/content/rpg-sprite-sheet local img = love.graphics.newImage('Tile Sheet.png') l...
by pgimeno
Mon Mar 11, 2019 11:19 am
Forum: General
Topic: Does Löve support Linux..??
Replies: 1
Views: 323

Re: Does Löve support Linux..??

LÖVE runs on a Raspberry Pi 3b with Raspbian.
by pgimeno
Sun Mar 10, 2019 3:13 am
Forum: General
Topic: LuaJIT's FFI not working?
Replies: 3
Views: 455

Re: LuaJIT's FFI not working?

Hi, welcome to the forums!

Could it be a bits mismatch? I mean in the 32 vs 64 sense. Perhaps love and lua are compiled for a different number of bits?
by pgimeno
Wed Mar 06, 2019 7:02 pm
Forum: General
Topic: Reading binary files quickly.
Replies: 21
Views: 3320

Re: Reading binary files quickly.

Fair enough, unpack doesn't support all possible structures, and arrays are among those unsupported.
by pgimeno
Wed Mar 06, 2019 12:51 pm
Forum: General
Topic: Reading binary files quickly.
Replies: 21
Views: 3320

Re: Reading binary files quickly.

You have to do lots of string slicing and formatting/concatenation for that, and it results in slow code that's hard to read. unpack accepts an offset parameter. Wouldn't that obviate the need of slicing? Where would you need the slicing/formatting/concatenation with unpack which you don't with oth...
by pgimeno
Tue Mar 05, 2019 10:45 pm
Forum: General
Topic: Reading binary files quickly.
Replies: 21
Views: 3320

Re: Reading binary files quickly.

print(love.data.unpack('<s2s2', '\005\000ABCDE\002\000FG')) -- prints "ABCDE FG 12" print(love.data.unpack('<c5c2', 'ABCDEFG')) -- prints "ABCDE FG 8" print(love.data.unpack('<i2i4s2I2', '\254\255\001\000\000\000\018\000STRING OF 18 BYTES\254\255')) --prints: -- -2 1 STRING OF 18 BYTES 65534 29 -- ...