Packagecom.divillysausages.gameobjeditor
Classpublic class Editor
InheritanceEditor Inheritance Object

The main class that we use to parse a class and take out all the editable variables. When we select an object that we have info for, we generate the components needed to edit our variables.



Public Properties
 PropertyDefined By
  clickToSelect : Boolean
[write-only] Can we click to select our object (DisplayObjects only)
Editor
  clickToSelectMatchParent : Boolean
[write-only] When clickToSelect is enabled, should we match against the parent of the clicked object (from the MouseEvent).
Editor
  currentObject : *
[read-only] Get the current object that we're editing
Editor
  gui : GUI
[read-only] The gui for the Editor, if you want to make changes to it
Editor
  highlightCurrentLineColour : uint
[write-only] The colour of the line when we're highlighting the current object
Editor
  highlightCurrentLineSize : Number
[write-only] The size of the line when we're highlighting the current object
Editor
  highlightCurrentObject : Boolean
[write-only] Should we highlight the current object when it's selected?
Editor
  stage : Stage
[read-only] A reference to the main Stage
Editor
  updateOnlyWatchVars : Boolean
[write-only] When updating every frame, should we update everything or only the "watch" variable types?
Editor
  visible : Boolean
Makes the Editor visible and adds it to the stage
Editor
  x : Number
Editor
  y : Number
Editor
Public Methods
 MethodDefined By
  
Editor(stage:Stage)
Creates the Editor
Editor
  
log(msg:String, level:int = 1):void
Traces out a message to the console and the log panel
Editor
  
registerClass(clazz:Class):void
Registers a class to be parsed for editable variables
Editor
  
registerObject(obj:*):void
Registers an object so it can be edited.
Editor
  
unregisterObject(obj:*):void
Unregisters an object from the editable array.
Editor
Property Detail
clickToSelectproperty
clickToSelect:Boolean  [write-only]

Can we click to select our object (DisplayObjects only)

The default value is true.


Implementation
    public function set clickToSelect(value:Boolean):void
clickToSelectMatchParentproperty 
clickToSelectMatchParent:Boolean  [write-only]

When clickToSelect is enabled, should we match against the parent of the clicked object (from the MouseEvent). Helps deal with clicking on children when their parents are the ones being edited

The default value is true.


Implementation
    public function set clickToSelectMatchParent(value:Boolean):void
currentObjectproperty 
currentObject:*  [read-only]

Get the current object that we're editing

The default value is null.


Implementation
    public function get currentObject():*
guiproperty 
gui:GUI  [read-only]

The gui for the Editor, if you want to make changes to it


Implementation
    public function get gui():GUI
highlightCurrentLineColourproperty 
highlightCurrentLineColour:uint  [write-only]

The colour of the line when we're highlighting the current object

The default value is 0xff0000.


Implementation
    public function set highlightCurrentLineColour(value:uint):void
highlightCurrentLineSizeproperty 
highlightCurrentLineSize:Number  [write-only]

The size of the line when we're highlighting the current object

The default value is 1.0.


Implementation
    public function set highlightCurrentLineSize(value:Number):void
highlightCurrentObjectproperty 
highlightCurrentObject:Boolean  [write-only]

Should we highlight the current object when it's selected?

The default value is false.


Implementation
    public function set highlightCurrentObject(value:Boolean):void
stageproperty 
stage:Stage  [read-only]

A reference to the main Stage


Implementation
    public function get stage():Stage
updateOnlyWatchVarsproperty 
updateOnlyWatchVars:Boolean  [write-only]

When updating every frame, should we update everything or only the "watch" variable types?

The default value is true.


Implementation
    public function set updateOnlyWatchVars(value:Boolean):void
visibleproperty 
visible:Boolean

Makes the Editor visible and adds it to the stage


Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
xproperty 
x:Number


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number


Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor Detail
Editor()Constructor
public function Editor(stage:Stage)

Creates the Editor

Parameters
stage:Stage — A reference to the Stage
Method Detail
log()method
public function log(msg:String, level:int = 1):void

Traces out a message to the console and the log panel

Parameters

msg:String — The message we're tracing
 
level:int (default = 1) — The level of the message; this is used to colour code trace outputs if your IDE supports it

registerClass()method 
public function registerClass(clazz:Class):void

Registers a class to be parsed for editable variables

Parameters

clazz:Class — The Class that we want to parse

registerObject()method 
public function registerObject(obj:*):void

Registers an object so it can be edited. If the object is already in our edit list, it's ignored. If it's class hasn't been previously registered, it's ignored.

Parameters

obj:* — The object that we want to register so we can edit it

unregisterObject()method 
public function unregisterObject(obj:*):void

Unregisters an object from the editable array.

Parameters

obj:* — The object that we want to unregister