Page 1 of 1

Window Icon

Posted: Sat Jul 18, 2015 7:00 pm
by rod_sn
Hey guys before posting i tried to search on google and love forums for my issue but what i found did not helped. I have been trying to get an icon on the game window without success... I have tried the following codes (0.9.2):

conf.lua

Code: Select all

t.window.icon = "res/cookie.png"
main.lua

Code: Select all

ico = love.image.newImageData("res/cookie.png")
ok = love.window.setIcon(ico)
print(ok)
I even tried to change from the image (.png) to the icon (.ico) files, just to get an "Could not decode image" error.

I have managed to add an icon on version 0.8.0 using the same code*.
Why isn't it working on 0.9.2?

EDIT:
*using .graphics instead of .window

Re: Window Icon

Posted: Sat Jul 18, 2015 7:08 pm
by DaedalusYoung
Using the same code in 0.8.0? Are you sure? Because it wasn't love.window in 0.8.0 yet. Maybe you're mixing up your versions, it works in 0.9.2, but not in 0.8.0?

Re: Window Icon

Posted: Sun Jul 19, 2015 12:16 am
by rod_sn
My bad, in the 0.8.0 version i used graphics instead of window.

Re: Window Icon

Posted: Sun Jul 19, 2015 11:52 am
by rod_sn
it works in 0.9.2, but not in 0.8.0?
No, it works on 0.8.0 but not on 0.9.2

Re: Window Icon

Posted: Sun Jul 19, 2015 2:22 pm
by DaedalusYoung
Well, I don't know then, looks like it should work. Care to post a .love?

Re: Window Icon

Posted: Sun Jul 19, 2015 4:00 pm
by rod_sn
Ok so i sent my game to my friends, and they say they see a icon... So this seems to be a problem from my computer... Anyways here is the love game i am using to test this issue:

Re: Window Icon

Posted: Sun Jul 19, 2015 4:09 pm
by Nixola
I do see the icon, Windows 7 x64.

Re: Window Icon

Posted: Sun Jul 19, 2015 6:01 pm
by DaedalusYoung
Works for me on Mac as well.

Btw, don't create a new image in your love.draw function. This function runs every frame, so it will cause all sorts of issues in larger projects. Just create it once (like in love.load) and then you can just draw it whenever you want to.

Re: Window Icon

Posted: Sun Jul 19, 2015 7:09 pm
by rod_sn
Btw, don't create a new image in your love.draw function. This function runs every frame, so it will cause all sorts of issues in larger projects. Just create it once (like in love.load) and then you can just draw it whenever you want to.
yea i know that, thank you XD i was just testing the icon so i did it the easy way. Anyways windows 8.1 here and the icon is not showing up.. pretty strange... I don't really need to see it anyways, i was just scared i wouldn't be able to include an icon. But if its there, its enough. Thanks guys, if anyone knows the issue and how to fix it, that would be cool. :P