Page 12 of 91

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 9:15 am
by bartbes
You probably want to add a line like

Code: Select all

tex.a *= color.a;
Considering colour values go from 0 to 1 in glsl, this should do what you expect it to.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 9:17 am
by rmcode
Works like a charme (and more importantly I now understand why and what I did wrong). Thanks bartbes.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 11:47 am
by Whatthefuck
slime wrote:If you use this (all you need to do is require the file) then you'll get the performance of LuaJIT's FFI when calling ImageData methods, without having to worry about whether your C pointer / array arithmetic is correct.
Holy shit dude, you just saved my life.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 2:28 pm
by murks
How well do the different libraries go together? Is it possible to use Middleclass, hump.gamestate, Hardoncollider and Löve frames for example or is that just calling for trouble?

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 2:57 pm
by bartbes
They should be fine, in fact, if you also use MiddleClass-Commons HardonCollider will use MiddleClass for its classes.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 3:10 pm
by murks
Thanks Bartbes, I'll give it a go.
There i one thing about class commons that is a bit unclear to me: Do I have to use the class commons syntax or can I use the middleclass syntax?

Edit: And somewhat related: Does middleclass-commons only work if I require it globally or is there a way to use it if I require it to a local variable?

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 4:28 pm
by Whatthefuck
Is there any way to load .lua files in threads? I tried doing require "filename", but it errors out in the thread.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 4:44 pm
by murks
I'm not sure, but usually loading lua files in the main thread is not an issue. Images and so on is a different matter, and for that there is https://github.com/kikito/love-loader.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 5:22 pm
by bartbes
murks wrote: There i one thing about class commons that is a bit unclear to me: Do I have to use the class commons syntax or can I use the middleclass syntax?
The entire idea behind class commons is that you can use your class library of choice! So use the middleclass syntax.
murks wrote: Edit: And somewhat related: Does middleclass-commons only work if I require it globally or is there a way to use it if I require it to a local variable?
It doesn't return anything, so.. don't assign it to anything?

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Sep 03, 2014 5:47 pm
by murks
Well, ok, it's just that in the middleclass examples it is assigned to a local variable, and I try to avoid globals. Example: https://github.com/kikito/middleclass/w ... ck-Example

It also assumes that middleclass.lua is in the same directory as main.lua, but this is easy enough to change.