2008年1月4日金曜日

Hello jiggy!

I've made a HelloWorld with "jiggy", the javascript-based IDE for iPhone/iPod touch. I'll show the steps.

Login to jiggy

  1. launch jiggy in your iPhone/iPod touch.
  2. access to jiggy with the browser of your Mac/PC. the IP to access is on the screen.
  3. login to jiggy with the User name and the Password on the screen.

Create new application -- HelloJiggy

  1. click "Create new application" on the left navigation.
  2. input "Title" and "Identifier." Below is an example. ("Description", "Version", "Author", "URL", "Icon" are your options)
    Title:      HelloJiggy
    Identifier: jp.kamonama(.hellojiggy)
  3. click "Save" below the form.
  4. it's ok that your iPhone/iPod touch has been locked.

Hello jiggy!

  1. unlock your iPhone/iPod touch and launch jiggy.
  2. access to jiggy.
  3. click "HelloJiggy" come up on the left navigation.
  4. click "main.js" in the "HelloJiggy" folder.
  5. write the code below in main.js.
    Plugins.load( "UIKit" );

    var rect = UIHardware.fullScreenApplicationContentRect
    rect[0] = rect[1] = 0;

    var window = new UIWindow( rect );
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.backgroundColor = [ 1.0 , 1.0 , 1.0, 1.0 ];

    var hello = new UITextLabel( rect );
    hello.text = "Hello jiggy!";
    hello.backgroundColor = [ 0.6 , 0 , 0 , 1.0 ];
    hello.setFont( new Font( "Trebuchet MS" , 2 , 46 ) );
    hello.color = [ 1 , 1 , 1 , 1 ];
    hello.centersHorizontally = true;

    window.setContentView( hello );
  6. click the floppy-disk icon to save main.js.
  7. click the right-pointing triangle icon to run HelloJiggy. (or tap the HelloJiggy icon on the spring board of your iPhone/iPod touch.)
  8. Congratulation! HelloJiggy is running, now!

0 件のコメント: