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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Locked
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

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

Post by rmcode »

Works like a charme (and more importantly I now understand why and what I did wrong). Thanks bartbes.
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

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

Post 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.
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

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

Post 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?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

They should be fine, in fact, if you also use MiddleClass-Commons HardonCollider will use MiddleClass for its classes.
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

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

Post 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?
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

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

Post by Whatthefuck »

Is there any way to load .lua files in threads? I tried doing require "filename", but it errors out in the thread.
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

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

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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?
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

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

Post 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.
Locked

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests