Jiggy Image Question

Discussion in 'Jiggy Runtime Development' started by plokiju, Mar 11, 2008.

  1. plokiju

    plokiju New Member

    Joined:
    Nov 5, 2007
    Messages:
    537
    Likes Received:
    5
    Hi I'm trying to make an application with Jiggy. does anyone know how to make an image full screen instead of a solid colour? If anyone can help, Ill rep u
  2. iamcanadian

    iamcanadian New Member

    Joined:
    Nov 29, 2007
    Messages:
    335
    Likes Received:
    15
    status bar:
    Code:
    Plugins.load( "UIKit" );
    
    var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.backgroundColor = [ 0 , 0 , 0 , 225 ]
    
    var yourimage = new UIImage( "image.png")
    yurimage.position = [-35, -60]
    mainView.addSubview( yourimage );
    If you want no status bar then:

    Plugins.load( "UIKit" );

    Code:
    var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.level = 1001;
    window.position = [0,0]; 
    window.backgroundColor = [ 0 , 0 , 0 , 225 ]
    
    var yourimage = new UIImage( "image.png")
    yurimage.position = [0,0]
    mainView.addSubview( yourimage );
    
    1 person likes this.
  3. plokiju

    plokiju New Member

    Joined:
    Nov 5, 2007
    Messages:
    537
    Likes Received:
    5
    Ok thatks ill try that


    Edit: I always get this error

    ReferenceError: mainView is not defined
    Line 11 in file /private/var/mobile/Applications/Test.app/main.js

    any suggestions?

    Edit2: I got it to work by typing this

    Code:
    Plugins.load( "UIKit" );
    
    var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.backgroundColor = [ 1 , 1 , 1 , 1 ];
    
    var mainView = new UIView();
    window.setContentView( mainView );
    var yourimage = new UIImageView( "2.png");
    yourimage.position = [0,0];
    mainView.addSubview( yourimage );
    but there is no image, just a blank screen.
  4. Commander147

    Commander147 Member

    Joined:
    Oct 10, 2007
    Messages:
    78
    Likes Received:
    4
    Device:
    iPhone 4 (Black)
    your declaring your images wrong
    do this
    ===============================================
    var start = new UIImageView( new Image( "/Pictures/blank.png" ) );
    start.bounds = [ 0, 0 , 320 , X];
    start.position = [0, 48];
    mainView.addSubview( start );
    ===============================================
    if you have a nav bar use 412 instead of X but if you want full screen use 480 instead of X
  5. iamcanadian

    iamcanadian New Member

    Joined:
    Nov 29, 2007
    Messages:
    335
    Likes Received:
    15
    opps forgot i sorta was rushing to post that was about to go out

    Please Register or Log in to view images

Share This Page