Zeus Auto-Complete for the Corona SDK

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Zeus Auto-Complete for the Corona SDK

Post by jussij »

Initial Setup

Find below a file that provides Zeus auto-complete for the Corona SDK.

Note: The directions below assume you are running Windows XP (see below if this is not the case)

To use this file do the following:
  1. Create a new workspace called Lua in the following folder location:

    Code: Select all

    c:\Program Files\Zeus\zTags\
  2. Remove the Header and Resource folders.
  3. Add this file (which should already exist) to the Source folder of that workspace:

    Code: Select all

    c:\Program Files\Zeus\zTags\Templates\Lua.js
  4. Replace the contents of that file with the code found below.
Now create a new Lua file and type in some code like this:

Code: Select all

display.
The intellisense for the display object should now be shown as expected.

Note: If you are running on Windows 7 then the location of these files will be different.

To find the corrent location just use the Macro, Load menu and in the resulting dialog move up one folder level to help the correct zTags folder location.

Setup Syntax Highlighting

To get the Zeus syntax highlighter to recognise these keywords do the following:
  1. Use the Options, Document Types menu to edit the Lua Document Type.
  2. Select the Keywords panel and hit the Tags Syntax Highlighting button.
  3. Tick the Classes, Functions, Methods, and Variables check boxes.
  4. Apply the changes.
  5. Select the Coloring panel and in the Category section adjust the Tag - * color values to suit.
  6. Apply the changes.
Zeus - Corona SDK API Reference

Code: Select all

//
//  Zeus - Corona SDK API Reference
//  ---------------------------------------------------------------------
//
//  Created using this web page:
//
//     http://developer.anscamobile.com/reference
//

assert();
error();
getfenv();
getmetatable();
ipairs();
next();
pairs();
pcall();
print();
rawequal();
rawget();
rawset();
select();
setfenv();
setmetatable();
tonumber();
tostring();
type();
unpack();

class coroutine
{
    create(f);
    resume(co [, val1, ···]);
    running();
    status(co);
    wrap(f);
    yield(···);
}

class debug
{
    debug();
    getfenv(o);
    gethook([thread]);
    getinfo([thread,] function [, what]);
    getlocal([thread,] level, local);
    getmetatable(object);
    getregistry();
    getupvalue(func, up);
    setfenv(object, table);
    sethook([thread,] hook, mask [, count]);
    setlocal([thread,] level, local, value);
    setmetatable(object, table);
    setupvalue(func, up, value);
    traceback([thread,] [message] [, level]);
}

class ads
{
    hide();
    init();
    show();
};

class analytics
{
    init();
    logEvent();
};

class easing
{
    inExpo();
    inOutExpo();
    inOutQuad();
    inQuad();
    linear();
    outExpo();
    outQuad();
};

class movieclips
{
    newAnim();
    nextFrame();
    play();
    previousFrame();
    reverse();
    setDrag();
    setLabels();
    stop();
    stopAtFrame();
}

class transitions
{
    cancel();
    dissolve();
    from();
    to();
};

class table
{
    concat(table [, sep [, i [, j]]]);
    copy(table);
    indexOf();
    insert(table, [pos,] value);
    maxn(table);
    remove(table [, pos]);
    sort(table [, comp]);
};

class audio
{
    dispose();
    fade();
    fadeOut();
    findFreeChannel();
    freeChannels;
    getDuration();
    getMaxVolume();
    getMinVolume();
    getVolume();
    isChannelActive();
    isChannelPaused();
    isChannelPlaying();
    loadSound();
    loadStream();
    pause();
    play();
    reserveChannels();
    reservedChannels;
    resume();
    rewind();
    seek();
    setMaxVolume();
    setMinVolume();
    setVolume();
    stop();
    stopWithDelay();
    totalChannels;
    unreservedFreeChannels;
    unreservedUsedChannels;
    usedChannels;
};

class credits
{
    init();
    requestUpdate();
    showOffers();
};

class crypto
{
    digest();
    hmac();
    md4
    md5
    sha1
    sha224
    sha256
    sha384
    sha512
};

class display
{
    display.remove();
    addEventListener;
    contentToLocal();
    dispatchEvent();
    getParent();; // **old**
    localToContent();
    removeEventListener();
    removeSelf();
    rotate();
    scale();
    setMask();
    setReferencePoint();
    toBack();
    toFront();
    translate();

    // Common Properties
    alpha;
    contentBounds;
    contentHeight;
    contentWidth;
    height;
    isHitTestMasked;
    isHitTestable;
    isVisible;
    length; // **old**
    maskRotation;
    maskScaleX;
    maskScaleY;
    maskX;
    maskY;
    parent;
    rotation;
    stageBounds; // **old**
    stageHeight; // **old**
    stageWidth; // **old**
    width;
    x;
    xOrigin;
    xReference;
    xScale;
    y;
    yOrigin;
    yReference;
    yScale;

    // Content Size Properties
    contentCenterX;
    contentCenterY;
    contentHeight;
    contentScaleX;
    contentScaleY;
    contentWidth;
    screenOriginX;
    screenOriginY;
    statusBarHeight;
    viewableContentHeight;
    viewableContentWidth;

    // Factory Functions
    loadRemoteImage();
    newCircle();
    newEmbossedText();
    newGroup();
    newImage();
    newImageRect();
    newLine();
    newRect();
    newRetinaText();
    newRoundedRect();
    newText();

    // Group Display Objects
    numChildren;
    insert();
    remove();

    // Other Display Functions
    captureScreen();
    save();
    setDefault();
    setStatusBar();

    // Stage Display Objects
    getCurrentStage();
    setFocus();

    // Text Display Objects
    size;
    text;
    setTextColor();

    // Vector Display Objects
    strokeWidth;
    append();
    setColor();
    setFillColor();
    setStrokeColor();
};

class event
{
    memoryWarning; // *iOS only*

    // Detect Network Status
    address;
    isConnectionOnDemand;
    isConnectionRequired;
    isInteractionRequired;
    isReachable;
    isReachableViaCellular;
    isReachableViaWiFi;
    name;

    // In-App Purchases
    invalidProducts;
    products;
    transaction;

    // Runtime
    addEventListener();
    removeEventListener();

    // accelerometer
    deltaTime;
    isShake;
    xGravity;
    xInstant;
    yGravity;
    yInstant;
    zGravity;
    zInstant;

    // audio
    channel;
    completed;
    handle;

    // collision
    phase;

    // completion
    action;
    blob;
    index;
    target;

    // creditsRequest
    newCredits;
    totalCredits;

    // enterFrame
    time;

    // gyroscope
    xRotation;
    yRotation;
    zRotation;

    // heading(compass);
    geographic;
    magnetic;

    // key
    keyName;

    // location(GPS);
    accuracy;
    altitude;
    direction;
    latitude;
    longitude;
    speed;

    // mapAddress
    city;
    cityDetail;
    country;
    countryCode;
    isError;
    postalCode;
    region;
    regionDetail;
    street;
    streetDetail;

    // notification
    custom;
    type;

    // orientation
    delta;

    // postCollision
    force;
    friction;
    object1
    object2

    // preCollision
    other;

    // sprite
    sprite;

    // tap
    numTaps;
    x;
    y;

    // timer
    count;
    source;

    // touch
    id;
    xStart;
    yStart;

    // urlRequest
    errorCode;
    errorMessage;
    url;
};

class facebook
{
    login();
    logout();
    request();
    showDialog();
};

// File I/O
// Explicit file manipulation
class file
{
    close();
    flush();
    lines();
    read(···);
    seek([whence] [, offset]);
    setvbuf(mode [, size]);
    write(···);
}

//Implicit file manipulation
class io
{
    close([file]);
    flush();
    input([file]);
    lines([filename]);
    open(filename [, mode]);
    output([file]);
    read(···);
    tmpfile();
    type(obj);
    write(···);
}

// Game Network
class gameNetwork
{
    init();
    request();
    show();
};

class graphics
{
    newGradient();
    newMask();
};

// In-App Purchases
class store
{
    canMakePurchases;
    finishTransaction();
    init();
    loadProducts();
    purchase();
    restore();
};

class json
{
    decode();
    encode();
    null();
};

class math
{
    abs(x);
    acos(x);
    asin(x);
    atan(x);
    atan2(y, x);
    ceil(x);
    cos(x);
    cosh(x);
    deg(x);
    exp(x);
    floor(x);
    fmod(x, y);
    frexp(x);
    huge;
    ldexp(m, e);
    log(x);
    log10(x);
    max(x, ···);
    min(x, ···);
    modf(x);
    pi;
    pow(x, y);
    rad(x);
    random([m [, n]]);
    randomseed(x);
    round(x);
    sin(x);
    sinh(x);
    sqrt(x);
    tan(x);
    tanh(x);
}

// Modules and Packages
module();

class package
{
    loaded
    loaders
    seeall(module);
};

require();

// Multimedia
class media
{
    pauseSound();
    newRecording();
    newEventSound();
    getSoundVolume;
    playEventSound();
    playSound();
    playVideo();
    setSoundVolume();
    show();
    stopSound();
    getSampleRate();
    getTunerFrequency();
    getTunerVolume();
    isRecording();
    setSampleRate();
    startRecording();
    startTuner();
    stopRecording();
    stopTuner();
};

class network
{
    // Asynchronous HTTP
    download();
    request();

    // Detect Status
    canDetecttatusChanges;
    setStatusListener;
};

class openfeint
{
    downloadBlob();
    init();
    launchDashboard();
    setHighScore();
    unlockAchievement();
    uploadBlob();
};

// Operating System Facilities
class os
{
    clock();
    date([format [, time]]);
    difftime(t2, t1);
    execute([command]);
    exit([exit_code]);
    remove(filename);
    rename(oldname, newname);
    time([table]);
};

class physics
{
    addBody();
    getGravity();
    newJoint();
    pause();
    removeBody();
    setDrawMode();
    setGravity();
    setPositionIterations();
    setScale();
    setVelocityIterations();
    start();
    stop();
}

class body
{
    // Bodies
    angularDamping;
    angularVelocity;
    bodyType;
    isAwake;
    isBodyActive;
    isBullet;
    isFixedRotation;
    isSensor;
    isSleepingAllowed;
    linearDamping;
    applyAngularImpulse();
    applyForce();
    applyLinearImpulse();
    applyTorque();
    getLinearVelocity();
    resetMassData();
    setLinearVelocity;
}

class joint
{
    // Joints
    dampingRatio;
    frequency;
    isLimitEnabled;
    isMotorEnabled;
    jointAngle;
    jointSpeed;
    jointTranslation;
    length;
    length1
    length2
    maxForce;
    maxMotorForce;
    maxMotorTorque;
    maxTorque;
    motorForce;
    motorSpeed;
    motorTorque;
    ratio;
    reactionTorque;
    getAnchorA();
    getAnchorB();
    getLimits();
    getReactionForce();
    getRotationLimits();
    setLimits();
    setRotationLimits();
};

// Sprite Sheets
class sprite
{
    add();
    newSprite();
    newSpriteMultiSet();
    newSpriteSet();
    newSpriteSheet();
    newSpriteSheetFromData();
};

// Sprite Instance
class spriteInstance
{
    animating;
    currentFrame;
    sequence;
    timeScale;
    addEventListener();
    pause();
    play();
    prepare();
}

class spriteSheet
{
    dispose();
};

//Storyboard
//Scene Template
class storyboard
{
    getPrevious();
    getScene();
    gotoScene();
    newScene();
    purgeAll();
    purgeScene();
    removeAll();
    removeScene();
};

class string
{
    byte(s, i, j);
    char(···);
    dump(function);
    find(s, pattern [, init [, plain]]);
    format(formatstring, ···);
    gmatch(s, pattern);
    gsub(s, pattern, repl [, n]);
    len(s);
    lower(s);
    match(s, pattern [, init]);
    rep(s, n);
    reverse(s);
    sub(s, i [, j]);
    upper(s);
}

class system
{
    DocumentsDirectory;
    ResourceDirectory;
    TemporaryDirectory;
    activate();
    cancelNotification();
    getInfo();
    getPreference();
    getTimer();
    hasEventSource();
    openURL();
    orientation;
    pathForFile();
    scheduleNotification();
    setAccelerometerInterval();
    setGyroscopeInterval();
    setIdleTimer();
    setLocationAccuracy();
    setLocationThreshold();
    vibrate();
};

class timer
{
    cancel();
    pause();
    performWithDelay();
    resume();
};

// Widget
// Bitmap Masks for tableViews and scrollViews
class widget
{
    newButton();
    newPickerWheel();
    newScrollView();
    newSlider();
    newTabBar();
    newTableView();
    setTheme();
};

// Native UI(native seems to be a JacaScript keyword!!!)
class Native
{
    cancelAlert();
    getFontNames();
    newFont();
    setActivityIndicator();
    setKeyboardFocus();
    showAlert();
    showPopup();
    systemFont;

    // Input Text Fields
    newTextField();
    align;
    font;
    inputType;
    isSecure;
    size;
    text;
    setTextColor();

    // Maps
    isLocationVisible;
    isScrollEnabled;
    isZoomEnabled;
    mapType;
    addMarker();
    getAddressLocation();
    getUserLocation();
    removeAllMarkers();
    setCenter();
    setRegion();
    newMapView();

    // Text Boxes
    newTextBox();
    align;
    font;
    hasBackground;
    isEditable;
    size;
    text;
    setTextColor();

    // Web Popups
    cancelWebPopup();
    showWebPopup();
};
Post Reply