Page 1 of 1

t.window.icon error : file does not exist

Posted: Tue May 14, 2019 10:01 am
by Mahdi
hi. i am a beginner in game development and i searched the forum for this issue and found none. hopefully this is not a repetitive topic.

i am using Intellij IDE with lua language to code, and i am running Love using command prompt ( I have another issue which is integrating Love pluging into Intellij).

in the conf.lua file, i have written the code(among other codes):
function love.conf(t)
t.window.icon = "myicon.png"

... and the myicon.png file is in the same directory as main.lua and conf.lua but when i run love, the default Love icon shows up at top left. and when i replace the "myicon.png" with the file path, Love runs the blue screen error with "file does not exist".


sidenote:
can anyone also help me with getting Love to run from inside Intellij?
thank you very much.

Re: t.window.icon error : file does not exist

Posted: Wed May 15, 2019 1:30 pm
by ertt
Hey.

Löve-Applications are running in a sandbox. You cannot access files outsite of this box.
So you can only reference files in the main-folder or included folders, not outside. It is not possible to reference to files in (for example) "c:\users\icon.png" but from "assets/icon.png" where "assets" is a folder application-root.

ertt

Re: t.window.icon error : file does not exist

Posted: Wed May 15, 2019 2:36 pm
by zorg
ertt wrote: Wed May 15, 2019 1:30 pm Löve-Applications are running in a sandbox. You cannot access files outsite of this box.
So you can only reference files in the main-folder or included folders, not outside. It is not possible to reference to files in (for example) "c:\users\icon.png" but from "assets/icon.png" where "assets" is a folder application-root.
Except the OP did say that
Mahdi wrote: Tue May 14, 2019 10:01 am ... and the myicon.png file is in the same directory as main.lua and conf.lua
So that should be correct. "myicon.png" means it's either in the root of the project folder (where main.lua is) or the root of the project's save folder (currently irrelevant).

It may be a few things, but i don't know what restrictions may apply to set an image as an (application) icon; culprits could include dimensions not being supported, or color depth, or compression method, or additional tags and blocks in the file (which shouldn't be an issue, but the possibility still exists).

Re: t.window.icon error : file does not exist

Posted: Wed May 15, 2019 4:38 pm
by ertt
zorg wrote: Wed May 15, 2019 2:36 pm Except the OP did say that
Mahdi wrote: Tue May 14, 2019 10:01 am ... and the myicon.png file is in the same directory as main.lua and conf.lua
Oh sorry, i misunderstood the post. I thought that the imagepath was replaced with another filename, which is maybe outside the folder..
According to the wiki: large iconfiles maybe not supported.
Which love version did you use? Did you test this with other files/filetypes?

ertt

Edit: did it work when you set the icon by code?

Re: t.window.icon error : file does not exist

Posted: Fri May 17, 2019 10:11 am
by Mahdi
hi. thank you all for the replies. I am using love version 11.2
and the file isn't really large. its under 100 kbs.

also erret:
Edit: did it work when you set the icon by code?
how do i do that again?

Re: t.window.icon error : file does not exist

Posted: Fri May 17, 2019 2:49 pm
by ertt
Wiki say

Code: Select all

success = love.window.setIcon( imagedata )
Edit: i'm not sure if "large" file means the filesize or width/height. But i dont think that a icon needs to be 100kb...