Class: TexturedSurfaceShape

TexturedSurfaceShape()

If no image is set, it behaves the same as a SurfaceShape. To set an image pass it to the shape .image property (myShape.image = myImg;) Limitations with an image: The boundaries have to define a quadrilateral (can be defined by 4 corners) If the edges arc over the globe, the interior will not be filled properly Shapes that cross the anti-meridian will not use the image Performance is lower When used with an image it will divide the image in cells (based on the step, maxImageWidth, maxImageHeight values) and draw each image cell to the canvas This is a slow operation, try to keep the number of cells "low" For example: step = 1, maxImageWidth = 64, maxImageHeight = 64 will produce 4096 (64 * 64 * 1) cells

Constructor

new TexturedSurfaceShape()

Source:

Members

image :Image

Image to draw on the surface of the shape.
Type:
  • Image
Source:

maxImageWidth :Number

Resizes the image Higher numbers produce better textures at the expense of performance
Type:
  • Number
Source:

step :Number

Determines the division step of the image Lower numbers produce better textures at the expense of performance
Type:
  • Number
Source: