Apr 21, 2013

Apply the MIT License to software

This is a method to publish software that applied the MIT License.
In order to declare the software license,

  • Describe license in the file header comment
  • Include license text as text file
  • Display license text on the installer

And so on.

An easy way is to include text file.
Template of the MIT license is open to the public at the following websites.

Open Source Initiative
http://opensource.org/licenses/mit-license.php

Japanese translation by Open Source Group Japan
http://sourceforge.jp/projects/opensource/wiki/licenses%2FMIT_license

Copy the template and put your name in , and put also development year in
Save the file as "LICENSE.txt" and distribute software, and this method is complete.

Apr 20, 2013

Loop playback BGM with enchant.js

This is how to loop playback the BGM with enchant.js.

// Loop playback the bgm
game.assets['bgm.mp3'].play();
game.assets['bgm.mp3'].src.loop = true;

Be careful because loop parameter must set after play.

// This case not loop playback the bgm
game.assets['bgm.mp3'].src.loop = true;
game.assets['bgm.mp3'].play();

Apr 19, 2013

Trim images with Preview of Mountain Lion

This method is convenient to removing blank spaces from images.

Open the image with Preview.


Click the pencil icon to show tools.


Click the magical stick icon (instant alpha). If the icon is invisibility, widen window.


Drag area that you want remove, and make selected.


Press the Delete key and remove the area.


You can invert the selected area by command + shift + I.

Select the blank space with magical stick.

Press command + shift + I and invert the area.
You can remove the area that not selected by command + K.