"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 »

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.
User avatar
cere_ender
Prole
Posts: 9
Joined: Fri Sep 25, 2015 1:51 pm
Location: Barcelona, Spain

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

Post 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
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
cere_ender
Prole
Posts: 9
Joined: Fri Sep 25, 2015 1:51 pm
Location: Barcelona, Spain

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

Post 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?
User avatar
parallax7d
Citizen
Posts: 82
Joined: Wed Jul 02, 2014 11:44 pm

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

Post 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?
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 »

Yes, they are thread-safe.

EDIT: I should clarify: the implementation in love is thread-safe (and transparent).
User avatar
parallax7d
Citizen
Posts: 82
Joined: Wed Jul 02, 2014 11:44 pm

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

Post 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.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

parallax7d wrote:Do they lock the whole imagedata?
Yes.
User avatar
parallax7d
Citizen
Posts: 82
Joined: Wed Jul 02, 2014 11:44 pm

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

Post by parallax7d »

Speak of the devil :P That's cool, I'll stick to you're implementation then. thanks x2!
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

Keep in mind it will break in future versions.
Locked

Who is online

Users browsing this forum: Google [Bot] and 7 guests