Results 1 to 6 of 6

Thread: Unofficial Novashell Scripting API Documentation Thread

  1. #1
    Lesser Knight
    Join Date
    Dec 2006
    Location
    United States
    Posts
    47

    Default Unofficial Novashell Scripting API Documentation Thread

    I'll start with the Color class. These definitions are pretty obvious and uninteresting but oh well.

    Color(red: number, green: number, blue: number, alpha: number) -> Color

    :Getalpha() -> number
    Returns the alpha (transparency) value of the color object.

    :GetBlue() -> number
    Returns the blue value of the color object.

    :GetGreen() -> number
    Returns the green value of the color object.

    :GetRed() -> number
    Returns the red value of the color object.

    :Setalpha(alpha: number)
    Sets the alpha (transparency) value of the color object.

    :SetBlue(blue: number)
    Sets the blue value of the color object.

    :SetGreen(green: number)
    Sets the green value of the color object.

    :SetRed(red: number)
    Sets the red value of the color object.

    (Note to Seth: why are Setalpha/Getalpha not SetAlpha/GetAlpha? I've once already screwed up the name when trying to test it. )

  2. #2
    Lesser Knight
    Join Date
    Dec 2006
    Location
    United States
    Posts
    47

    Default Rect class

    Rect(x1: number, y1: number, x2: number, y2: number)

    :GetHeight() -> number
    Returns the height of the rectangle.

    :GetWidth() -> number
    Returns the width of the rectangle.

    :IsOverlapped() -> number
    This appears to be broken. I presume it should take a single argument (another Rect) and return true if the two overlap, but instead it takes no arguments and returns the same value as GetHeight().

    .bottom -> number
    The bottom y (y2) coordinate of the rectangle.

    .left -> number
    The left x (x1) coordinate of the rectangle.

    .right -> number
    The right x (x2) coordinate of the rectangle.

    .top -> number
    The top y (y1) coordinate of the rectangle.

  3. #3
    Lesser Knight
    Join Date
    Dec 2006
    Location
    United States
    Posts
    47

    Default Vector2 class

    Vector2(x: number, y: number) -> Vector2

    :Cross() -> number
    Returns the cross product of the vector. (In other words, it rotates the vector 90 degrees.)

    : Dot(Vector2) -> number
    Returns the dot product of the two vectors.

    :Length() -> number
    Returns the length of the vector.

    .x
    The x value of the vector.

    .y
    The y value of the vector.

  4. #4
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Default

    Ok, now I just feel guilty that I haven't put up API documentation yet, I'm going to make this a priority. The reason I've been putting it off is I want to setup a way to parse the source to build it, otherwise I'll never keep it updated.

    Agree on the Setalpha, I'm going to fix the capitalization in the next build, beware of script errors.

    And thanks, IsOverlapped was connected to GetHeight in luabind, whups!
    Seth A. Robinson
    Robinson Technologies

  5. #5
    Lesser Knight
    Join Date
    Dec 2006
    Location
    United States
    Posts
    47

    Default

    Quote Originally Posted by Seth View Post
    Ok, now I just feel guilty that I haven't put up API documentation yet, I'm going to make this a priority. The reason I've been putting it off is I want to setup a way to parse the source to build it, otherwise I'll never keep it updated.
    Something like Doxygen?

    Also, Novashell crashes when you try to call an internal-use symbol. (i.e. one of the following: App, BaseEntity, Brain, BrainManager, Camera, CameraSettings, DataManager, Entity, GameLogic, GoalManager, InputManager, LayerManager, Map, MapManager, Material, MaterialManager, SoundManager, State, TagObject, TagManager, TextManager, WatchManager.) Do any of these have any use inside Lua? If not, is it possible to make them invisible, or at least mangle their names?
    (I ran across this problem when I wanted to make a function called Map.)

  6. #6
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Default

    Quote Originally Posted by Ian View Post
    Something like Doxygen?

    Also, Novashell crashes when you try to call an internal-use symbol. (i.e. one of the following: App, BaseEntity, Brain, BrainManager, Camera, CameraSettings, DataManager, Entity, GameLogic, GoalManager, InputManager, LayerManager, Map, MapManager, Material, MaterialManager, SoundManager, State, TagObject, TagManager, TextManager, WatchManager.) Do any of these have any use inside Lua? If not, is it possible to make them invisible, or at least mangle their names?
    (I ran across this problem when I wanted to make a function called Map.)
    Hmm, I will check out Doxygen, I know there are a lot of C++ documentation systems but not sure if anything can format info from luabind declarations in a decent way. Would sure save some time to find something though!

    Reserved names of class types - these are all novashell classes that are exported to lua on purpose - (for instance, "this" is a pointer to an Entity object when used in an entities script) - and in some cases can be instantiated (Color, Rect) but in most cases you can't, except through special means. (CreateEntity, CreateSpecialEntity)

    I'm not sure if there is a way I can get lua to give a clear error if you use a reserved word or not, hate to see crashes happen for any reason.

    PS: Hmm, you know, I could probably obfuscate some of those names, like Map, internally and nobody would care, but I think in the future some of those may be instantiable, or you may want to use the lua method to get the class type, in that case you'd want to see the return value is a Map and not a MapJHD&23 or something.

    UPDATE: Some of novashells API documentation is now available here.
    Last edited by Seth; 01-17-2007 at 06:45 AM.
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Dictionary Additions Thread
    By Seth in forum Dungeon Scroll for PC and iPhone
    Replies: 39
    Last Post: 04-29-2016, 09:43 AM
  2. Generating documentation
    By TauCeti in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 10-30-2006, 01:55 PM
  3. scripting engine
    By elite_coder in forum Game development
    Replies: 4
    Last Post: 07-04-2004, 07:42 AM
  4. FQ Scripting
    By jjohn in forum Funeral Quest
    Replies: 11
    Last Post: 07-02-2003, 09:40 AM
  5. Scripting in Unicode?
    By jjohn in forum Funeral Quest
    Replies: 3
    Last Post: 12-18-2002, 06:32 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •