Skip to content

02 Creating a Cadet Scene

Robert Silverton edited this page Jul 8, 2014 · 2 revisions

Now that your CadetEditor extension is setup, launch the CoreEditor_AIR project selecting the CoreEditor_AIR_CadetEditor configuration, as explained in the previous tutorial.

Select the Barebones2D template from the Splash Screen. This template simply creates a Cadet scene with a Renderer2D component from an XML serialized template, which can be found here:

[CoreEditor-as]/deploy/extensions/fileTemplates/barebones2DS.cdt2d

Hopefully the behind the scenes process here of contributing a file type and associating an editor with the CoreEditor_AIR app rings a bell now from reading the File Types tutorial in the CoreEditor tutorials.

The code responsible for these contributions can be found in the application file CadetEditor_Ext_2DS.as within the CadetEditor_Ext_2DS project, and looks like this:

// File Types
resourceManager.addResource( new FileType( "Cadet2D Editor Scene", "cdt2d", CadetEditorIcons.CadetEditor ) );

// Editors
resourceManager.addResource( new EditorFactory( CadetEditorContext2D, "Cadet2D Editor", "cdt2d", CadetEditorIcons.CadetEditor ) );

Also, in the same way that the first run of the CoreEditor app created the folder My Documents/CoreEditor, the first run of the CadetEditor2D app created the folder My Documents/Cadet2D. This acts as the default folder for the application to load and save files from.

Now select “File/Save”, call the file scene1 and click “save”. Next select “File/Close”, the “File/Open...”, select scene1.cdt2d from the dialogue and press OK. The scene will reopen.


< Previous | Next >