Search found 234 matches

by KayleMaster
Thu Oct 26, 2017 4:36 pm
Forum: Support and Development
Topic: math.random > love.math.random
Replies: 10
Views: 14790

math.random > love.math.random

I did some test while optimizing a problematic loop and these are my findings:
2621440 tests
math.random ~25ms
love.math.random ~35 ms
Is this because of the extra access table (love.) ?
Just something interesting I found.
by KayleMaster
Sun Aug 06, 2017 10:17 am
Forum: Support and Development
Topic: Using spritebatches
Replies: 2
Views: 1561

Re: Using spritebatches

Yeah, I just found out my gpu supports up to 8192x8192. However, if it doesn't support it, it will not get loaded into the VRAM but rather RAM (tested with a 10kx10k image). So it shouldn't be that big of a deal. Probably a performance hit but that requires some more testing. My gpu is fairly new, b...
by KayleMaster
Sun Aug 06, 2017 8:44 am
Forum: Support and Development
Topic: Using spritebatches
Replies: 2
Views: 1561

Using spritebatches

I have an isometric game and the terrain is spritebatched. Tiles of 32x16, 8 variations, rather small sprite. However I decided that the animated & static objects (buildings and units) on top of the terrain to be also spritebatched. At first this meant I would need to use a rather large image an...
by KayleMaster
Wed Apr 19, 2017 6:41 pm
Forum: Support and Development
Topic: Pattern matching
Replies: 5
Views: 3158

Re: Pattern matching

I've always wondered how a function can return two values, in this case, to t and c. And I always forget I can do that...
by KayleMaster
Wed Apr 19, 2017 5:38 pm
Forum: Support and Development
Topic: Pattern matching
Replies: 5
Views: 3158

Pattern matching

Here I am again. I'm kinda new to lua's strings, being a C guy and all, and I don't really know every function, so can you help me? I have this string: wood|1000 so the pattern is word|digits First I need to get word and compare it, if it's =="wood" for example and then I need to get the v...
by KayleMaster
Mon Apr 17, 2017 8:56 pm
Forum: Support and Development
Topic: Detect if capslock is toggled on ?
Replies: 9
Views: 6700

Re: Detect if capslock is toggled on ?

Oh nice, didn't know about pattern matching yet.
Is the parameter of textinput a string, a key, or something else?
by KayleMaster
Mon Apr 17, 2017 3:47 pm
Forum: Support and Development
Topic: Detect if capslock is toggled on ?
Replies: 9
Views: 6700

Re: Detect if capslock is toggled on ?

I don't want any special symbols in my string so I just wrote my own that accepts A-Z, a-z, 0-9.
How would I handle that with textinput?
by KayleMaster
Mon Apr 17, 2017 1:42 pm
Forum: Support and Development
Topic: Detect if capslock is toggled on ?
Replies: 9
Views: 6700

Re: Detect if capslock is toggled on ?

But the input has to be case-sensitive and I don't want to remove this functionality which is pretty much built in Windows from the user.
If I have to, I will check on which OS the user is (I'm planning a release for Windows and Linux only for now).
by KayleMaster
Mon Apr 17, 2017 1:19 pm
Forum: Support and Development
Topic: Can I cram all of this into a table?
Replies: 21
Views: 11814

Re: Can I cram all of this into a table?

Ah, you were referring to MasterLee's code, yeah, got it.
by KayleMaster
Mon Apr 17, 2017 1:01 pm
Forum: Support and Development
Topic: Can I cram all of this into a table?
Replies: 21
Views: 11814

Re: Can I cram all of this into a table?

English is not my native language so can you please expand on that? "every time closure is generated" what is a closure in this scenario? usernameBox ? And I assume the functions which you are talking about are new,draw and init? Do you mean new ones are created when I create usernameBox f...