Function for add icons of our programs

Community Forums/Monkey2 Talk/Function for add icons of our programs

artidomedesX(Posted 2015) [#1]
Monkey and Blitz Max/Blitz3D is cool and simple tools for creating games, but I see one little problem. Setting own/custom icon for our applications. In many tools for making games it is just a few "mouse clicks" or few lines of code. I found on forum (Monkey and BlitzMax forum) tutorials how set icon and it looks a bit complicated and requires a bit of a work/time or we need special program for this.
Please add the function for fast and simple setting icon of our programs made on Monkey-X/Monkey2.
For example:

SetDeskopApplicationIcon ("mygamefolder/icon.ico") - for windows exe file

SetAndroidApplicationIcon ("mygamefolder/icon.ico") - for android app (At this moment i have free version - deskop/html of Monkey so i'm not sure there is "icon function" for android applications)
etc.

I bought BlitzMax and Blitz3D few years ago and i will buy Monkey-X (Now I work on free - Deskop/html version), but please add this function on Monkey-X and Monkey2 (In future) and will be really nice :)

Greetings!

PS: I didn't know where write this post, so I wrote in few forums. Sorry for the spam.


Nobuyuki(Posted 2015) [#2]
Some relevant information might be in the Build system thread. Individually target-dependent functions aren't a normal part of the monkey language - therefore this functionality would probably be better suited for the build system itself.


Soap(Posted 2015) [#3]
http://www.monkey-x.com/Community/posts.php?topic=9172

The default target could include an icon by default (some do already), and include a function to turn an icon.png in the project folder into target specific icons and then place them in the right locations depending on target.


marksibly(Posted 2015) [#4]
I think this sort of thing should probably be part of the pre/post build steps, eg:

#POST_BUILD+="setexeicon ${OUT_FILE} ${CD}/myicon.ico"


dawlane(Posted 2015) [#5]
Adding an icon to a Windows executable shouldn't be a problem with winres. OS X would require a bit of app bundle manipulation after building or hacking the Xcode project file before building. But Linux doesn't work in that way due to the number of Window Manages and Desktop Environments that can be used. It is still basically, a GUI built on top of DOS.

The main distributions will either use GNOME or KDE as their defaults. These are full desktop environments and follow the freedesktop specifications. It basically use a Desktop Entry file (like a Windows lnk) that only the desktop environment can read for information on the icon, pop-up hint and launcher. Unfortunately this mean that the application has to be installed correctly with icons and Desktop Entry files in the correct file system locations for anything to work. A distribution such as the now discontinued crunchbang Linux that used Openbox doesn't support such a thing out of the box and requires jumping through a few hoops to set up correctly.


Samah(Posted 2015) [#6]
@dawlane: But Linux...GUI built on top of DOS.

I wasn't aware Linux ran DOS. ;)
(I get what you mean though)

Also I agree this should be a build configuration thing, but it should be platform independent . The trans implementation could automatically call the utilities it needs to, but the developer should only have to put in config.monkey:
#APPICON="mygame.png"



marksibly(Posted 2015) [#7]
I agree there should be a target independent way to do things like this, but what I don't like is that trans ends up getting munged up with all sorts of special case code.

Some way to externalise this stuff would be nice. Off the top of my head, monkey2 could come with a bunch of useful shell commands in the bin dir (eg: rm, cp, chmod, seticon) that can be called the same way regardless of host. So...

#POST_BUILD+="seticon ${OUT_FILE} ${CD}/appicon.ico"

...would work regardless of host since all versions of monkey will have a functional seticon tool in their bin dir.

This way, new tools can be added without having to clutter up trans.


Samah(Posted 2015) [#8]
@marksibly: #POST_BUILD+="seticon ${OUT_FILE} ${CD}/appicon.ico"

This would probably be ok, as long as the command is automatically added to config.monkey as part of the build process for the selected target. This way you wouldn't need a separate "magic" tool to handle adding icons. One less thing to compile. :)


itto(Posted 2015) [#9]
I think opening up the build system to provide more customization is badly needed. At the very least the possibility to set in the build file most of the common options needed for the specific target. Also, since the build system is comprised of many different tasks all executing one after the other non-stop, it would be great to split it in each specific phase and have the possibility to define some "hooks" to trigger at different stages of the build process. This could simply be a path to a script/bin file to be called by the host system, but already a lot flexible.


dawlane(Posted 2015) [#10]
@Mark: I did suggest in the Build System topic that Trans should not be that all in-one tool for every thing and a more modular approach was needed. Hence the need of a separate program to control the build process.
http://www.monkey-x.com/Community/posts.php?topic=9715&post=102978

I wasn't aware Linux ran DOS. ;)
Every one assumes the DOS is a Microsoft thing.... It isn't. It's a general term for any computer that was operated by a command line. :-P