t.window.icon error : file does not exist

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
Mahdi
Prole
Posts: 2
Joined: Tue May 14, 2019 9:29 am

t.window.icon error : file does not exist

Post 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.
User avatar
ertt
Prole
Posts: 10
Joined: Mon Mar 20, 2017 11:02 pm

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

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

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

Post 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).
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
ertt
Prole
Posts: 10
Joined: Mon Mar 20, 2017 11:02 pm

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

Post 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?
Mahdi
Prole
Posts: 2
Joined: Tue May 14, 2019 9:29 am

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

Post 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?
User avatar
ertt
Prole
Posts: 10
Joined: Mon Mar 20, 2017 11:02 pm

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

Post 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...
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 79 guests