Search found 587 matches

by grump
Sat May 25, 2019 10:55 pm
Forum: General
Topic: TV Effect
Replies: 5
Views: 2789

Re: TV Effect

Example attached
by grump
Mon May 20, 2019 4:10 am
Forum: Support and Development
Topic: LUA question about visibility
Replies: 17
Views: 3412

Re: LUA question about visibility

Why would class ( ) return class? I'd expect class to return a (!) class, from which you subsequently create instances. There's code in my reply that illustrates my point. It's not about metamethods; it's about the difference between classes and instances/objects. Edit: Ooh, sorry, I think I finall...
by grump
Sun May 19, 2019 3:29 pm
Forum: Support and Development
Topic: LUA question about visibility
Replies: 17
Views: 3412

Re: LUA question about visibility

zorg wrote:
Sun May 19, 2019 3:19 pm
Edit: unless that 201 is that...
It is. 1 local per line, and it failed at line 201. Also, the "more than 200" message :)
by grump
Sun May 19, 2019 2:51 pm
Forum: Support and Development
Topic: LUA question about visibility
Replies: 17
Views: 3412

Re: LUA question about visibility

Last I heard the limit was exactly 200 for any given scope. It is: http://lua-users.org/lists/lua-l/2014-04/msg00385.html At least with vanilla lua, but luajit should be the same. Time for science! local code = {} for i = 1, 1e6 do code[i] = ('local x%d = %d'):format(i, i) assert(loadstring(table.c...
by grump
Sun May 19, 2019 2:30 pm
Forum: Support and Development
Topic: LUA question about visibility
Replies: 17
Views: 3412

Re: LUA question about visibility

It's a common practice to call the class to create new instances of the class, provided "__call" metamethod is defined. It's equivalent of calling class:new but uses Lua builtin dispatch system instead of actually calling "new" manually. Right. My confusion is not about technical details, but about...
by grump
Sun May 19, 2019 9:34 am
Forum: Support and Development
Topic: LUA question about visibility
Replies: 17
Views: 3412

Re: LUA question about visibility

raidho36 wrote:
Sun May 19, 2019 8:42 am

Code: Select all

local class = require ( "class" )

local instance1 = class ( "foo" )
local instance2 = class ( "bar" )
Either your terminology is off, or I don't understand what this is supposed to do. Why does the class function return instances?
by grump
Sat May 18, 2019 1:38 pm
Forum: Support and Development
Topic: LUA question about visibility
Replies: 17
Views: 3412

Re: LUA question about visibility

And the question is that in main I can do the next: function love.draw() periodic_table:draw() element.WIDTH = 5 end Why I can change "element.WIDTH", if it was a local object of "periodic table" inside the "load" function? I think I could not access to element because it is not in the scope, but I...
by grump
Thu May 16, 2019 11:05 am
Forum: Games and Creations
Topic: A Shader Que.
Replies: 12
Views: 4253

Re: A Shader Que.

You have to actually use the variable in the shader. Not just declare it. It has to be referenced somewhere in the shader code, or else the shader compiler will remove it.

Please use the Support subforum for future help requests.
by grump
Thu May 09, 2019 5:52 pm
Forum: Support and Development
Topic: saving a canvas as an image
Replies: 15
Views: 5349

Re: saving a canvas as an image

i don't like ideology with "my documents" folder. good old games always do save in their folders. Good old games did it this way because they're old, they were played on single-user systems, and filesystem permissions did not exist. Today, any user data is expected to be saved in the user's home di...