Page 79 of 91

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

Posted: Wed Nov 16, 2016 9:31 pm
by bartbes
Remscar wrote: After doing more digging i'm thinking that the console output is getting sent back to Atom (Text editor I use and I launch the game from). Is there a way to force Love2d to make a console window and send the output there instead?
Only if you can disable that in Atom. Editors on windows force the thing they're running to redirect output to them instead of the console.

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

Posted: Thu Nov 17, 2016 4:03 pm
by cere_ender
Hello, I am a programmer and I am trying to switch to Love2D to make my first game on smartphone, but I'm doing my firsts tests and I'm failing.

I tried lclass and middleclass to create a Button, but with the option to make a simple button or a textured button. But when I create the main.lua,button.lua, and ctrlC+CtrlZ the middleclass.lua to my device It shows nothing. Here's my code:
Button.lua
http://paste.ofcode.org/357kE79mV2Lj4UEHmKqEYMn

Main.lua
http://paste.ofcode.org/8jx6qwBUBM6WBgxzHCuduk

thanks for your help

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

Posted: Thu Nov 17, 2016 5:19 pm
by zorg
cere_ender wrote:Hello, I am a programmer and I am trying to switch to Love2D to make my first game on smartphone, but I'm doing my firsts tests and I'm failing.

I tried lclass and middleclass to create a Button, but with the option to make a simple button or a textured button. But when I create the main.lua,button.lua, and ctrlC+CtrlZ the middleclass.lua to my device It shows nothing. Here's my code:

thanks for your help

Code: Select all

function love.draw()
    -- You're missing something here: aButton:draw()
end

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

Posted: Thu Nov 17, 2016 5:21 pm
by cere_ender
zorg wrote:
cere_ender wrote:Hello, I am a programmer and I am trying to switch to Love2D to make my first game on smartphone, but I'm doing my firsts tests and I'm failing.

I tried lclass and middleclass to create a Button, but with the option to make a simple button or a textured button. But when I create the main.lua,button.lua, and ctrlC+CtrlZ the middleclass.lua to my device It shows nothing. Here's my code:

thanks for your help

Code: Select all

function love.draw()
    -- You're missing something here: aButton:draw()
end
Yup, I supposed it. But if I do a bunch of buttons, entities, etc, will have a lot of :draw? or I have to do a function for each part of the game? Doesn't have some method to invoke all draws/updates/loads/etc?

Edit: I changed to lclass and redid buttons.lua, but It still not showing anything. Here's the code:
Main-
http://paste.ofcode.org/YTpuZp85ePH2atffxqBGs4

Button
http://paste.ofcode.org/FsxaFr66JxgSUTy5wEqGjJ

Edit 2: I returned to middleclass, but still did nothing. Maybe is because I have three classes inside the same file?

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

Posted: Thu Nov 17, 2016 8:32 pm
by parallax7d
It looks like Slime's ffi imagedata methods (or something similar) were integrated into Love in 0.9.2 Are these thread safe? Do they put a lock on an entire imagedata, thus preventing multiple threads from accessing a single imagedata at the same time?

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

Posted: Thu Nov 17, 2016 8:46 pm
by bartbes
Yes, they are thread-safe.

EDIT: I should clarify: the implementation in love is thread-safe (and transparent).

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

Posted: Thu Nov 17, 2016 9:20 pm
by parallax7d
Do they lock the whole imagedata? The reason I ask is because I'll need to have n threads writing to different addresses in the same texture atlas to make using threads worth while.

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

Posted: Thu Nov 17, 2016 9:28 pm
by slime
parallax7d wrote:Do they lock the whole imagedata?
Yes.

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

Posted: Thu Nov 17, 2016 9:42 pm
by parallax7d
Speak of the devil :P That's cool, I'll stick to you're implementation then. thanks x2!

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

Posted: Thu Nov 17, 2016 10:09 pm
by slime
Keep in mind it will break in future versions.