ImageMeshColor
require(["esri/geometry/support/ImageMeshColor"], function(ImageMeshColor) { /* code goes here */ });
Class:
esri/geometry/support/ImageMeshColor
Inheritance: ImageMeshColor Accessor
Since: ArcGIS API for JavaScript 4.7
ImageMeshColor is a type of mesh color that represents an image mapped to the mesh by its uv vertex attributes. ImageMeshColor instances can be used with the MeshComponent.material.color property.
var meshColor = new ImageMeshColor({
url: "./image.png"
});
var mesh = Mesh.createBox(location, {
material: {
color: meshColor
}
});
// Mesh colors support autocasting within a mesh material constructor
var mesh2 = Mesh.createSphere(location, {
material: {
color: {
type: "image",
url: "./image.png"
}
}
});
// Mesh materials also support additional advanced autocasting types
// such as a Canvas element. In this case the canvas element is converted
// to a data URI set as the URL of the ImageMeshColor instance.
var mesh2 = Mesh.createSphere(location, {
material: {
color: canvasElement
}
});
// Here mesh2.material.color is an ImageMeshColor instance with its url
// property set to the data uri representing the contents of the canvas.
- See also:
Constructors
- Parameter:properties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Name | Type | Summary | Class | |
---|---|---|---|---|
declaredClass | String | The name of the class. more details | more details | Accessor |
type | String | For ImageMeshColor the type is always | more details | ImageMeshColor |
url | String | The url to the image resource. more details | more details | ImageMeshColor |
Property Details
- Since: ArcGIS API for JavaScript 4.7
The name of the class. The declared class name is formatted as
esri.folder.className
.
- typeStringreadonly
For ImageMeshColor the type is always
image
.
- urlString
The url to the image resource. This can either be a remote url (absolute or relative) or a data url.
Method Overview
Name | Return Type | Summary | Class | |
---|---|---|---|---|
clone() | ImageMeshColor | Creates a deep clone. more details | more details | ImageMeshColor |
Method Details
- clone(){ImageMeshColor}
Creates a deep clone.
Returns:Type Description ImageMeshColor A deep clone of the object that invoked this method.
Loading...
API Reference search results
Name | Type | Module |
---|