EditorItem

Package: Libraries.Interface.Controls.Scenes.Items · Inherits from: Libraries.Interface.Item, Libraries.Language.Object

The Editor Item class represents an object in the Scene Editor that is in the scene and is being added, removed, or having its properties modified. The main purpose of this class is to get and set information about certain properties of an item in the scene such as those for physics calculations like mass and restitution. Properties relating to physics and others important to the scene like position and the texture of the object will be saved to the scene file.

Actions

GainedFocus(Libraries.Interface.Events.FocusEvent event)

Internal action so that when an object in the editor gains focus it also tells the SceneEditor class that this is the item that currently has the selection.

Parameters

GainedSelection()

Internal action so that when an object in the editor gains focus it also tells the SceneEditor class that this is the item that currently has the selection.

GetConstants()

Used Internally. This action returns the class that contains all the constants used by this object.

Returns

Libraries.Interface.Controls.Scenes.SceneConstants

GetEditorFriction()

This action gets the coefficient of friction that is stored inside this editor property holder.

Returns

number: the coefficient of friction.

GetEditorMass()

This action returns the mass of the object set in the editor in kilograms.

Returns

number: the mass of the object.

GetEditorResponsiveness()

This action returns how physics (linear velocity, angular velocity, force, torque) will affect the object. There are three possible values to be returned: 0 indicates that the object is UNMOVABLE, which means no matter what forces or torques is applied to the object, the object will not move. 1 indicates that the object is NON_RESPONSIVE, which means that only setting the angular velocity and linear velocity of this object will affect how the object behaves. 2 indicates that the object is REPONSIVE, which means that this object will behave differently when you apply forces and torques to this object.

Returns

integer: Returns how physics will affect the object.

GetEditorRestitution()

This action returns how much energy that this object will loose after a collision.

Returns

number: the coefficient of restitution.

GetSceneEditor()

Returns the SceneEditor object that this item is a part of.

Returns

Libraries.Interface.Controls.Scenes.SceneEditor: The SceneEditor this item is attached to

IsEditorPhysicsEnabled()

This action returns true if physics is currently enabled for this item.

Returns

boolean: True if physics is enabled, false otherwise.

LostSelection()

Used Internally. This action returns the class that contains all the constants used by this object.

NotifyAccessibility(text message)

This action is used to send a message down to the Accessibility system so the user can notified of something that has changed or something the user may need to know to understand what is happening.

Parameters

  • message text

ResetScale()

ResetScale sets the scale of the object along each axis to the default which is usually 1. The scale of the object affects how large it is in the scene. So a scale of 2 on the x-axis means the object is twice as big on the x-axis than when normally sized.

SetEditorFriction(number friction)

This action sets the coefficient of friction that is stored inside this editor property holder.

Parameters

  • friction number: the coefficient of friction.

SetEditorMass(number mass)

This action changes the mass of this object.

Parameters

  • mass number: The mass of the object in kilograms.

SetEditorPhysicsEnabled(boolean enable)

This action sets whether or not this object will part of physics calculations that happen as the game runs. If phyics is not enabled then certain properties of the item will cause an error if the user attempts to view or change them. If physics is enabled than the object can be affected by force, and velocity calculations as the game runs.

Parameters

  • enable boolean: If true the physics enabled property will be set to true, false otherwise

SetEditorResponsiveness(integer responsive)

This action sets how physics (linear velocity, angular velocity, force, torque) will affect the object. There are three possible values to be set: 0 indicates that the object is UNMOVABLE, which means no matter what forces or torques is applied to the object, the object will not move. 1 indicates that the object is NON_RESPONSIVE, which means that only setting the angular velocity and linear velocity of this object will affect how the object behaves. 2 indicates that the object is REPONSIVE, which means that this object will behave differently when you apply forces and torques to this object.

Parameters

  • responsive integer: Integer representing how physics will affect the object.

SetEditorRestitution(number restitution)

This action sets how much energy that this object will loose after a collision. If you want the object to not loose any energy, then you can pass in 1.0. If you want the object to loose a lot of energy (meaning, they would probably move a lot slower after the collision), then you can pass in a 0.0. You can also use the values between 0 and 1.

Parameters

  • restitution number: The coefficient of restitution.

SetSceneEditor(Libraries.Interface.Controls.Scenes.SceneEditor editor)

Sets the SceneEditor object that this item is a part of.

Parameters

Inherited Actions

84 actions from Libraries.Interface.Item
3 actions from Libraries.Language.Object