Can the love2d open a Chinese path?

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.
Post Reply
User avatar
qwws
Prole
Posts: 10
Joined: Fri Aug 25, 2023 11:40 am
Location: Guangdong Province,China

Can the love2d open a Chinese path?

Post by qwws »

My Windows user name is chinese ,I use filesystem loading image after obtaining the love2d path(known images exist).but love2d reported an error,saying that the image does not exist. :(
Attachments
code for error reporting section.lua
(1.56 KiB) Downloaded 60 times
::Hello::
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Can the love2d open a Chinese path?

Post by slime »

love functions that accept a filepath all take a path that's relative to the game's source and save directories, not an absolute path.

So this code

Code: Select all

love.graphics.newImage(love.filesystem.getSaveDirectory().."/chart/"..item.."/"..citem)
should be this instead:

Code: Select all

love.graphics.newImage("chart/"..item.."/"..citem)
User avatar
qwws
Prole
Posts: 10
Joined: Fri Aug 25, 2023 11:40 am
Location: Guangdong Province,China

Re: Can the love2d open a Chinese path?

Post by qwws »

Thank you very much.
::Hello::
Post Reply

Who is online

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