Create a native bundle for os x.

Show us your creations and tactics!

Create a native bundle for os x.

Postby vivian_maes » Thu Apr 05, 2012 9:08 am

On mac os x towns start with a command file. But with this solution a terminal window remains open.
I have created a native bundle to start Towns.
For this you must install the developer tools.

first create a icon file.

start the icon composer. You can find this with spotlight.

drag and drop the file townslogo.png and the icon.png from graphics folder into the composer.
The file can find in the towns directory.

Image

Normaly you composer like this print screen.

Image

save you icon.

Create a basic bundle for java application

start the jar bundler application. You can find this with spotlight.

In "Build Information" tab

Image

For the main class select the file [towns]/lib/xaos.jar. note xaos.Towns is the name of the mainClass
type -jar lib/xaos.jar on the fiedl "Argument to main".

chose the 1.5+ version for the JVM version

chose your icon created on the step one

in the "Classpath and file" tab

Image

add all file from the directory [towns]/lib/ in the section "File and resource", the section classpath is filled automatically.

in the "Properties" tab

Image

Add -Djava.library.path=$JAVAROOT/native/ on the "VM Option"

check the box "Set Working Directory to Inside Application Path"

Set 512 for the Heap memory ( I use 1Gb for my bundle, but on the command file is 512Mb)

Now create your Apps

Last step modify your bundle

Right click on the the bundle and select show the package content. You can see this file structure.

Image

Copy the file from town game into your bundle. After this the bundle look like this.

Image

double click on the Info.plist file, a plist editor appear and show this.

Image

modify the plist file to have this and save

Image

Now you can copy your bundle into you application directory.
The Game appear into your launchPad, and it run like a native Os X application

Image

Vivian
vivian_maes
 
Posts: 2
Joined: Thu Apr 05, 2012 8:03 am

Re: Create a native bundle for os x.

Postby supermalparit » Thu Apr 05, 2012 10:59 am

Cool! Sticked!
Xavi Canal
Image
User avatar
supermalparit
Towns team
 
Posts: 2444
Joined: Thu Oct 27, 2011 11:57 pm

Re: Create a native bundle for os x.

Postby vivian_maes » Thu Apr 05, 2012 1:36 pm

Whaaa TKZ
vivian_maes
 
Posts: 2
Joined: Thu Apr 05, 2012 8:03 am

Re: Create a native bundle for os x.

Postby Deedasmi » Wed Apr 18, 2012 1:12 am

Why are the mac threads in screens instead of support?
Tired of mud? Try my Mud Mod
Deedasmi
 
Posts: 199
Joined: Tue Mar 06, 2012 9:49 pm

Re: Create a native bundle for os x.

Postby wizardjian » Sat May 12, 2012 4:15 pm

lol nice
Emotions are a hiderance...
Life is just a illusion...
Toughts are usless...
Sanity is a lie...

Froggie's Diary-http://townsgame.com/forums/viewtopic.php?f=12&t=3544
Moving Forwards Into The Future-http://tinyurl.com/c9gulrk
User avatar
wizardjian
 
Posts: 504
Joined: Sat May 05, 2012 11:20 pm

Re: Create a native bundle for os x.

Postby rickyjack » Tue Jul 10, 2012 4:25 pm

On Mac I use Apples native packaging as an application bundle. Either take the latest released Coccinella, open the application bundle by control clicking, replace the coccinella folder with your own.
Image

You can also get any other later TkAqua. Pick the self contained one (TclTkAquaStandalone). You need to copy the Info.plist file, the icon and the PkgInfo file from the original released Coccinella. Replace also the Contents/lib folder with the one in the Coccinella bundle since you do not need all of them. You can also get more detailed info from (broken URL).
rickyjack
 
Posts: 1
Joined: Tue Jul 10, 2012 4:20 pm

Re: Create a native bundle for os x.

Postby GeTheFunkOut » Sat Sep 29, 2012 3:56 am

You are a genius I have been looking how to do this for sooo soo long so I could play with the steam overlay. I had to mess around with it for a while because coding is stubborn and i kept on forgetting / or other stupid things. But i hm so happy you have bestowed this knowledge onto me
GeTheFunkOut
 
Posts: 9
Joined: Thu Aug 16, 2012 8:47 am


Return to Screens & tips

Who is online

Users browsing this forum: No registered users and 1 guest