TargetPosition: Object
The TargetPosition property determines target position of tag cloud item.
Target position is an item position on the next animation step.
The object contains following fields:
Position. Item target position, object of the PP.Vector3 class.
FontSize. Font size of the header.
Alpha. Value of the item transparency.
Color. Text color.
Scale. Scale.
Use JSON or the setTargetPosition method to set the property value and the getTargetPosition method to get the property value.
To execute the example, the page must contain the TagCloud component named tagCloud (see Example of Creating the TagCloud Component). The example must be placed in the <script> tag. Get target position and target color of the first cloud tag:
// Get color target value of the first tag var targetColor = tagCloud.getItems()[0].getTargetColor(); console.log("Color target color of the first tag: R = " + targetColor.R + ", G = " + targetColor.G + ", B = " + targetColor.B); // Get target coordinates of the first tag var targetXYZ = tagCloud.getItems()[0].getTargetPosition().Position; console.log("Target coordinate X: " + targetXYZ.getX()); console.log("Target coordinate Y: " + targetXYZ.getY()); console.log("Target coordinate Z: " + targetXYZ.getZ());
As a result the console displays target coordinates of position and target color of the cloud first tag:
Color target value of the active tag: R = 255, G = 70, B = 44
Target coordinate X: 150
Target coordinate Y: -112.5
Target coordinate Z: 0
See also: