Hi, I’d like to know if I can add an icon to the panda3d window in the title bar instead of having the basic icon.
First, place the icon file into your game folder. Then create a configuration file for your game in your game folder (if you haven’t already). Add a line such as this to the configuration file:
icon-filename game.ico
Then load the configuration file in your code before creating the main window. This can be done in the constructor of your showbase class, but must be done before calling the base constructor. Here’s an example:
from direct.showbase.ShowBase import ShowBase
from panda3d.core import load_prc_file
class Game(ShowBase):
def __init__(self):
load_prc_file("settings.prc")
ShowBase.__init__(self)
if __name__ == "__main__":
Game().run()
2 Likes
Thank you
This will work too.
from panda3d.core import WindowProperties
from direct.showbase.ShowBase import ShowBase
class Game(ShowBase):
def __init__(self):
ShowBase.__init__(self)
properties = WindowProperties()
properties.set_title('Half-Life 3')
properties.set_size(800, 600)
properties.set_icon_filename("pandaIcon.ico")
base.win.request_properties(properties)
game = Game()
game.run()
3 Likes
Thank you for resolve this issues.