a question about love.graphics.newImage( filename )

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: a question about love.graphics.newImage( filename )

Post by Jasoco »

Keep all a games resources inside the .love project ZIP/folder. Eventually you'll have to distribute them anyway. So it doesn't matter how big the project is really. The user will have to download the data eventually.
User avatar
Vsetup
Prole
Posts: 1
Joined: Tue May 12, 2009 7:51 pm

Re: a question about love.graphics.newImage( filename )

Post by Vsetup »

What if I have an, say, jigsaw puzzle game, and I want to let the user select the image that should be used, how can I achieve that?
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: a question about love.graphics.newImage( filename )

Post by Jasoco »

Well, they'll either have to place it in the sandbox folder, or you can use the code for downloading files from a server. Unfortunately you can't go out of the sandbox right now for security purposes.
TESLA
Prole
Posts: 2
Joined: Sun May 05, 2019 7:34 am

Re: a question about love.graphics.newImage( filename )

Post by TESLA »

Guys I did the exact same thing as you guys spoke above. I want to load a png spritesheet through

Code: Select all

function love.load()
 heroman = love.graphics.newImage("C:\Users\TESLA\Desktop\Engine\blocky.png")
where Engine is the file where love.exe is located and the whole thing is in the C: drive. When I run this on Love2D 11.1, it gives me an error that there is an invalid escape sequence near '"C:'. I'm really stuck here so if you guys can help I'm really thankful.
:o
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: a question about love.graphics.newImage( filename )

Post by zorg »

TESLA wrote: Sun May 05, 2019 5:21 pm Guys I did the exact same thing as you guys spoke above. I want to load a png spritesheet through

Code: Select all

function love.load()
 heroman = love.graphics.newImage("C:\Users\TESLA\Desktop\Engine\blocky.png")
where Engine is the file where love.exe is located and the whole thing is in the C: drive. When I run this on Love2D 11.1, it gives me an error that there is an invalid escape sequence near '"C:'. I'm really stuck here so if you guys can help I'm really thankful.
:o
Congratulations to another contestant in our gameshow, "Can you not necro-firstpost?"! :crazy:

...but seriously, i'm gonna assume you googled the topic and didn't check the last message being from 2010.

Anyway, here's another more recent thread about the issue: viewtopic.php?f=4&p=227141#p227141
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.
Post Reply

Who is online

Users browsing this forum: No registered users and 202 guests