guiObjectView - GetObject?
by Nicolai Dutka · in Torque Game Engine Advanced · 08/12/2009 (4:00 pm) · 3 replies
I need a little help here... I have a guiObjectView in one of my GUI's and would like to run 'setSkinName' on the object being viewed... I can't figure out how to do this...
I tried to run a '.dump' on the guiObjectView control, but the closest thing I can find in the output is:
getObject() - set.getObject(objIndex)
I have an object loaded into the viewer, I can see it, but the I am getting the following:
Any idea how I can get the object that is loaded into the object viewer so I can change the skinName?
I tried to run a '.dump' on the guiObjectView control, but the closest thing I can find in the output is:
getObject() - set.getObject(objIndex)
I have an object loaded into the viewer, I can see it, but the I am getting the following:
echo(guiObjectView.getObject(0)); -1 echo(guiObjectView.getObject(1)); -1
Any idea how I can get the object that is loaded into the object viewer so I can change the skinName?
#2
getClassName() - obj.getClassName()
getClassNamespace() -
getComponent() - (idx)
getComponentCount() - ()
getCount() - set.getCount()
getDynamicField() - obj.getDynamicField(index)
getDynamicFieldCount() - obj.getDynamicFieldCount()
getExtent() - Get the width and height of the control.
getField() - (int index) - Gets the name of the field at the given index.
getFieldCount() - () - Gets the number of persistent fields on the object.
getFieldType() - obj.getFieldType(fieldName);
getFieldValue() - obj.getFieldValue(fieldName);
getGlobalCenter() - returns center of control, as space seperated ints
getGlobalPosition() -
getGroup() - obj.getGroup()
getId() - obj.getId()
getInternalName() - getInternalName returns the objects internal name
getMinExtent() - Get the minimum allowed size of the control.
getName() - obj.getName()
getObject() - set.getObject(objIndex)
getParent() - returns the Id of the parent control
getPosition() -
getRoot() - returns the Id of the parent canvas.
getScriptFile() - GuiControl.getScriptFile() - gets the script file the control was created in
getSuperClassNamespace() -
getType() - obj.getType()
getValue() -
isActive() -
isAwake() -
isChildOfGroup() - returns true, if we are in the specified simgroup - or a subgroup thereof
isEnabled() - ()
isExpanded() - Get whether the object has been marked as expanded. (in editor)
isFirstResponder() - returns true if this control is the first responder,
isMember() - set.isMember(object)
isMemberOfClass() - isMemberOfClass(string classname) -- returns true if this object is a member of the specified class
isMethod() - obj.isMethod(string method name)
isSelected() - Get whether the object has been marked as selected. (in editor)
isVisible() -
listObjects() - set.listObjects();
makeFirstResponder() - (bool isFirst)
pointInControl() - returns true if the point is in the control, point is in parent coords
pushToBack() - set.pushToBack(object)
remove() - set.remove(obj1,...)
removeComponents() - %obj.removeComponents( %compObjName, %compObjName2, ... );
removeFieldFilter() - (fieldName)
reorderChild() - (child1, child2) uses simset reorder to push child 1 after child 2 - both must already be child controls of this control
resize() - (int x, int y, int w, int h)
save() - obj.save(fileName, <selectedOnly>)
schedule() - object.schedule(time, command, <arg1...argN>);
setActive() - (bool active)
setCanSave() - Sets whether this control can serialize itself to the hard disk
setCenter() - sets control position, by center - coords are local not global
setClassNamespace() -
setEnabled() - (enabled)
setExtent() - sets the width & height of the control.
setFieldType() - obj.setFieldType(fieldName, typeString);
setFieldValue() - obj.setFieldValue(fieldName,value);
setFirstResponder() - Sets this control as the first responder
setInternalName() - string InternalName
setIsExpanded() - Set whether the object has been marked as expanded. (in editor)
setIsSelected() - Set whether the object has been marked as selected. (in editor)
setModel() - (string shapeName)
Sets the model to be displayed in this control
param shapeName Name of the model to display.
setMount() - (string shapeName, int mountPoint)
Mounts the given model to the specified mount point of the primary model displayed in this control.
param shapeName Name of the model to mount.param mountPoint Index of the mount point to be mounted to. Corresponds to "mountPointN" in your shape where N is the number passed here.
setName() - obj.setName(newName)
setOrbitDistance() - (float distance)
Sets the distance at which the camera orbits the object. Clamped to the acceptable range defined in the class by min and max orbit distances.
param distance The distance to set the orbit to (will be clamped).
setPosition() - int x,y in local space
setPositionGlobal() - int x,y in global screen space
setProfile() - (GuiControlProfile p)
setSeq() - (int index)
Sets the animation to play for the viewed object.
param index The index of the animation to play.
setSuperClassNamespace() -
setValue() - (string value)
setVisible() - (bool visible)
08/19/2009 (10:27 pm)
Heres the rest of it. To many words for 1 post.getClassName() - obj.getClassName()
getClassNamespace() -
getComponent() - (idx)
getComponentCount() - ()
getCount() - set.getCount()
getDynamicField() - obj.getDynamicField(index)
getDynamicFieldCount() - obj.getDynamicFieldCount()
getExtent() - Get the width and height of the control.
getField() - (int index) - Gets the name of the field at the given index.
getFieldCount() - () - Gets the number of persistent fields on the object.
getFieldType() - obj.getFieldType(fieldName);
getFieldValue() - obj.getFieldValue(fieldName);
getGlobalCenter() - returns center of control, as space seperated ints
getGlobalPosition() -
getGroup() - obj.getGroup()
getId() - obj.getId()
getInternalName() - getInternalName returns the objects internal name
getMinExtent() - Get the minimum allowed size of the control.
getName() - obj.getName()
getObject() - set.getObject(objIndex)
getParent() - returns the Id of the parent control
getPosition() -
getRoot() - returns the Id of the parent canvas.
getScriptFile() - GuiControl.getScriptFile() - gets the script file the control was created in
getSuperClassNamespace() -
getType() - obj.getType()
getValue() -
isActive() -
isAwake() -
isChildOfGroup() - returns true, if we are in the specified simgroup - or a subgroup thereof
isEnabled() - ()
isExpanded() - Get whether the object has been marked as expanded. (in editor)
isFirstResponder() - returns true if this control is the first responder,
isMember() - set.isMember(object)
isMemberOfClass() - isMemberOfClass(string classname) -- returns true if this object is a member of the specified class
isMethod() - obj.isMethod(string method name)
isSelected() - Get whether the object has been marked as selected. (in editor)
isVisible() -
listObjects() - set.listObjects();
makeFirstResponder() - (bool isFirst)
pointInControl() - returns true if the point is in the control, point is in parent coords
pushToBack() - set.pushToBack(object)
remove() - set.remove(obj1,...)
removeComponents() - %obj.removeComponents( %compObjName, %compObjName2, ... );
removeFieldFilter() - (fieldName)
reorderChild() - (child1, child2) uses simset reorder to push child 1 after child 2 - both must already be child controls of this control
resize() - (int x, int y, int w, int h)
save() - obj.save(fileName, <selectedOnly>)
schedule() - object.schedule(time, command, <arg1...argN>);
setActive() - (bool active)
setCanSave() - Sets whether this control can serialize itself to the hard disk
setCenter() - sets control position, by center - coords are local not global
setClassNamespace() -
setEnabled() - (enabled)
setExtent() - sets the width & height of the control.
setFieldType() - obj.setFieldType(fieldName, typeString);
setFieldValue() - obj.setFieldValue(fieldName,value);
setFirstResponder() - Sets this control as the first responder
setInternalName() - string InternalName
setIsExpanded() - Set whether the object has been marked as expanded. (in editor)
setIsSelected() - Set whether the object has been marked as selected. (in editor)
setModel() - (string shapeName)
Sets the model to be displayed in this control
param shapeName Name of the model to display.
setMount() - (string shapeName, int mountPoint)
Mounts the given model to the specified mount point of the primary model displayed in this control.
param shapeName Name of the model to mount.param mountPoint Index of the mount point to be mounted to. Corresponds to "mountPointN" in your shape where N is the number passed here.
setName() - obj.setName(newName)
setOrbitDistance() - (float distance)
Sets the distance at which the camera orbits the object. Clamped to the acceptable range defined in the class by min and max orbit distances.
param distance The distance to set the orbit to (will be clamped).
setPosition() - int x,y in local space
setPositionGlobal() - int x,y in global screen space
setProfile() - (GuiControlProfile p)
setSeq() - (int index)
Sets the animation to play for the viewed object.
param index The index of the animation to play.
setSuperClassNamespace() -
setValue() - (string value)
setVisible() - (bool visible)
#3
from my experience with TGE (not TGEA):
you load your dts in the guiObjectView with :
I can't access the object in the view (getCount() return 0).
To change the skin, I did:
Hope that apply to TGEA.
Nicolas Buquet
www.buquet-net.com/cv/
08/20/2009 (5:32 am)
Hi Nicolai,from my experience with TGE (not TGEA):
you load your dts in the guiObjectView with :
myView.setObject("myObjArbitraryName", "path/to/dts/myObject.dts", "path/to/dts/mySkinBLUE.texture", 0);I can't access the object in the view (getCount() return 0).
To change the skin, I did:
myView.setObject("myObjArbitraryName", "path/to/dts/myObject.dts", "path/to/dts/mySkinRED.texture", 0);Hope that apply to TGEA.
Nicolas Buquet
www.buquet-net.com/cv/
Torque 3D Owner Harold Wilkins
Member Fields:
Accelerator = ""
AltCommand = ""
AnchorBottom = "0"
AnchorLeft = "1"
AnchorRight = "0"
AnchorTop = "1"
cameraZRot = "0"
canSave = "1"
canSaveDynamicFields = "0"
Command = ""
Docking = ""
Enabled = "1"
Extent = "370 460"
forceFOV = "0"
HorizSizing = "relative"
hovertime = "1000"
isContainer = "0"
langTableMod = ""
Margin = "0 0 0 0"
MinExtent = "8 2"
Padding = "0 0 0 0"
parentGroup = "StrAccesPane"
position = "303 5"
Profile = "GuiDefaultProfile"
ToolTip = ""
Variable = ""
VertSizing = "relative"
Visible = "1"
Tagged Fields:
Methods:
add() - set.add(obj1,...)
addComponents() - %obj.addComponents( %compObjName, %compObjName2, ... );
addFieldFilter() - (fieldName)
addGuiControl() - S32 controlId
bringToFront() - set.bringToFront(object)
call() - ( %args ) - Dynamically call a method on an object.
clear() - set.clear()
delete() - obj.delete()
dump() - obj.dump()
dumpClassHierarchy() - obj.dumpClassHierarchy()
findHitControl() - returns the Id of the control at the point
findObjectByInternalName() - string InternalName
getCenter() - returns center of control, as space seperated ints