Window Icon

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
rod_sn
Prole
Posts: 27
Joined: Sun Jan 11, 2015 9:59 am

Window Icon

Post by rod_sn » Sat Jul 18, 2015 7:00 pm

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
Last edited by rod_sn on Sun Jul 19, 2015 12:17 am, edited 1 time in total.
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien

User avatar
DaedalusYoung
Party member
Posts: 402
Joined: Sun Jul 14, 2013 8:04 pm

Re: Window Icon

Post by DaedalusYoung » Sat Jul 18, 2015 7:08 pm

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?

User avatar
rod_sn
Prole
Posts: 27
Joined: Sun Jan 11, 2015 9:59 am

Re: Window Icon

Post by rod_sn » Sun Jul 19, 2015 12:16 am

My bad, in the 0.8.0 version i used graphics instead of window.
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien

User avatar
rod_sn
Prole
Posts: 27
Joined: Sun Jan 11, 2015 9:59 am

Re: Window Icon

Post by rod_sn » Sun Jul 19, 2015 11:52 am

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
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien

User avatar
DaedalusYoung
Party member
Posts: 402
Joined: Sun Jul 14, 2013 8:04 pm

Re: Window Icon

Post by DaedalusYoung » Sun Jul 19, 2015 2:22 pm

Well, I don't know then, looks like it should work. Care to post a .love?

User avatar
rod_sn
Prole
Posts: 27
Joined: Sun Jan 11, 2015 9:59 am

Re: Window Icon

Post by rod_sn » Sun Jul 19, 2015 4:00 pm

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:
Attachments
ic.love
(151.47 KiB) Downloaded 58 times
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien

User avatar
Nixola
Inner party member
Posts: 1935
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Window Icon

Post by Nixola » Sun Jul 19, 2015 4:09 pm

I do see the icon, Windows 7 x64.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
DaedalusYoung
Party member
Posts: 402
Joined: Sun Jul 14, 2013 8:04 pm

Re: Window Icon

Post by DaedalusYoung » Sun Jul 19, 2015 6:01 pm

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.

User avatar
rod_sn
Prole
Posts: 27
Joined: Sun Jan 11, 2015 9:59 am

Re: Window Icon

Post by rod_sn » Sun Jul 19, 2015 7:09 pm

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
"You certainly usually find something, if you look, but it is not always quite the something you were after."
-Thorin Oakenshield, J.R.R. Tolkien

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Joelrodiel and 10 guests