Constructor
new ShapeAttributes(attributes)
Constructs a shape attributes bundle, optionally specifying a prototype set of attributes. Not all shapes
use all the properties in the bundle. See the documentation of a specific shape to determine the properties
it does use.
Parameters:
Name | Type | Description |
---|---|---|
attributes |
ShapeAttributes | An attribute bundle whose properties are used to initially populate the constructed attributes bundle. May be null, in which case the constructed attributes bundle is populated with default attributes. |
- Source:
Members
applyLighting :Boolean
Indicates whether lighting is applied to the shape.
Type:
- Boolean
- Default Value:
- false
- Source:
depthTest :Boolean
Indicates whether the shape should be depth-tested against other objects in the scene. If true,
the shape may be occluded by terrain and other objects in certain viewing situations. If false,
the shape will not be occluded by terrain and other objects.
Type:
- Boolean
- Default Value:
- true
- Source:
drawInterior :Boolean
Indicates whether the interior of the associated shape is drawn.
Type:
- Boolean
- Default Value:
- true
- Source:
drawOutline :Boolean
Indicates whether the outline of the associated shape is drawn
Type:
- Boolean
- Default Value:
- true
- Source:
drawVerticals :Boolean
Indicates whether this shape should draw vertical lines extending from its specified positions to the
ground.
Type:
- Boolean
- Default Value:
- false
- Source:
enableLighting :Boolean
Indicates whether lighting is applied to the associated shape.
Type:
- Boolean
- Default Value:
- false
- Source:
imageSource :String|ImageSource
Indicates the associated shape's image source. May be null, in which case no image is
applied to the shape.
Type:
- String | ImageSource
- Default Value:
- null
- Source:
interiorColor :Color
Indicates the associated shape's interior color and opacity.
Type:
- Default Value:
- Opaque white (red = 1, green = 1, blue = 1, alpha = 1)
- Source:
outlineColor :Color
Indicates the associated shape's outline color and opacity.
Type:
- Default Value:
- Opaque red (red = 1, green = 0, blue = 0, alpha = 1)
- Source:
outlineStippleFactor :Number
Indicates the associated shape's outline stipple factor. Specifies the number of times each bit in the
outline stipple pattern is repeated before the next bit is used. For example, if the outline stipple
factor is 3, each bit is repeated three times before using the next bit. The specified factor must be
either 0 or an integer greater than 0. A stipple factor of 0 indicates no stippling.
Type:
- Number
- Default Value:
- 0
- Source:
outlineStipplePattern :Number
Indicates the associated shape's outline stipple pattern. Specifies a number whose lower 16 bits
define a pattern of which pixels in the outline are rendered and which are suppressed. Each bit
corresponds to a pixel in the shape's outline, and the pattern repeats after every n*16 pixels, where
n is the stipple factor. For example, if the outline
stipple factor is 3, each bit in the stipple pattern is repeated three times before using the next bit.
To disable outline stippling, either specify a stipple factor of 0 or specify a stipple pattern of all 1 bits, i.e., 0xFFFF.
Type:
- Number
- Default Value:
- 0xF0F0
- Source:
outlineWidth :Number
Indicates the associated shape's outline width.
Type:
- Number
- Default Value:
- 1.0
- Source:
(readonly) stateKey :String
A string identifying the state of this attributes object. The string encodes the current values of all
this object's properties. It's typically used to validate cached representations of shapes associated
with this attributes object.
Type:
- String
- Source:
(protected) stateKeyInvalid :Boolean
Indicates whether this object's state key is invalid. Subclasses must set this value to true when their
attributes change. The state key will be automatically computed the next time it's requested. This flag
will be set to false when that occurs.
Type:
- Boolean
- Source:
Methods
(protected) computeStateKey() → {String}
Computes the state key for this attributes object. Subclasses that define additional attributes must
override this method, call it from that method, and append the state of their attributes to its
return value.
- Source:
Returns:
The state key for this object.
- Type
- String