Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Beta Documentation

The contents of this page are subject to change

The ifSGNodeField interface allows you to query, and get, set, and perform other similar manipulation operations on Scene Graph node fields. The ifSGNodeField interface also allows you to set and unset event observers on a subject node field.

Implemented by

Supported Methods

Description of Methods 

hasField(name as String) as Boolean

Returns true if the subject node has a field whose name exactly matches name, or whose fully lowercase analog is identical to that of name. Returns false otherwise.

getField(name as String) as Object

Returns the appropriately-typed value from the subject node field identified by name.

You can also use the node.field syntax to get the same result as getField(). That is, rectpos = rect.getField("translation") is equivalent to rectpos = rect.translation.

setField(name as String, value as Object)

Sets the value of the subject node field identified by name to value. This will fail and stop script execution if the value is not of the appropriate type.

You can also use the node.field syntax to get the same result as setField(). That is, rect.setField("opacity", 0.5) is equivalent to rect.opacity = 0.5.

setFields(aa as Object)

Sets the value of subject node fields indicated by the corresponding key.

observeField(name as String,  function as String)

Triggers the callback function identified by function when the subject node field identified by name changes value.

observeField(name as String,  port as Object)

Sends an roSGNodeEvent message to the roMessagePort identified by port when the subject node field identified by name changes value. Running the GetNode() function on the message will retrieve the ID of the node that changed, running the GetField() function on the message will get the name of the field that changed, and running the GetData() function on the message will get the new field value at the time of the change. This allows other threads to react to field changes, and avoids missing a value when the field changes twice before the message handler is able to receive the roSGNodeEvent messages.

unobserveField(name as String)

Removes the previously established connections between the subject node field identified by name and any callback functions or message ports.

 

  • No labels