Skip to content

Shrike78/StarlingCodea

Repository files navigation

StarlingCodea

StarlingCodea is a lua porting for Codea of the AS3 Starling Framework developed by Gamua OG. Starling itslef is the AS3 port of Sparrow, the Objective-C 2D framework developed always by Gamua OG.

StarlingCodea is a 2D framework that mimes the DisplayList of Adobe Flash/Flex, letting developer used to work with AS3 to easily move to Codea and Lua.

It offers:

  • A complete displayList optimized for bitmap rendering (through codea meshes and texture atlas) including:
    • DisplayObj
    • DisplayObjContainer
    • Stage
    • Quad
    • Image
    • MovieClip
    • Button
  • Animation facilities
  • Texture and Texture Atlas support, including TexturePacker file parsing
  • A full tweening library
  • EventHandling
  • Basic Touch Managament with drag and drop support

Contents

  • ExternalLibs.codea: Set of 3rd part libs used by StarlingCodea
  • Starling.codea: the main lib of the project
  • StarlingExamples: data files for StarlingExamples.codea
  • StarlingExamples.codea: a repository of examples for different StarlingCodea features
  • StarlingTween.codea: the StarlingCodea Tween library
  • Utils.codea: Several utilities used by StarlingCodea, like filesystem, xmlNode, math functions ecc.
  • LuaSandbox.lua: required to unsandbox codea lua environment and enable feature like libraries import and read/write of generic files

How to Install

The default installation requires to overwrite Codea luaSandbox.lua file with the one provided that removes all restrictions on what Codea programs can do. That's needed to enable import functionality between projects (thanks to Rui Viana) and read/write of generic files (like xml files).

Moreover the StarlingExamples.codea project is configured to look for the StarlingExamples data file directory as subfolder of Dropbox Codea sync folder (NB: even if Codea doesn't show subfolders or non png files in the Dropbox browser panel, the subfolders are correctly synched and browsed by the file system)

All the Projects.codea folders have to be copied under Codea/Documents folder on iPad, using tools that allows to browse iOS devices file system. (my favorite one is iFunBox)

It's anyway possible to run the example putting data files in other places, including a custom spritepack. Please refer to Utils/IO.lua file for more infos about file system support and configuration in sandboxed and unsandboxed environments.

Sandboxed Environment

StarlingCodea can be used also in a sandboxed environment, just with small changes on how to handle file system and library dependencies.

Consider that the sandboxed environment has two great limit:

  1. Codea support for lib dependencies (available from 1.4.3) is not recursive and so all the libs must be collapsed into a single project (that has to be done manually)

  2. Codea doesn't support load of generic files so even if it's still possibile to load images from dropbox, documents or spritepacks, for other files like xml there's no chance.

  • The only way is to convert them in lua files and add them to projects. For that reason StarlingCodea Texture Packer support includes not only a parser for Sparrow/Starling xml file format, but also one for Moai lua file format.
  • The 'require' function is missing, so lua file generated by 3rd part app (like TexturePacker) requires some little changes to globally expose generated datas.

StarlingExamples.codea already provides lua configuration files to be used in place of xmls, but it requires some time to be correctly configured.

About

Starling as3 framework ported to Lua (for Codea)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages