Tile
public class Tile : Propertied, Equatable
A Tile represents a 2D image that should be rendered when referenced on by an Object or Layer.
It contains a reference to the image, and the portion of that image that should be used to generate the image.
-
The URL of the image used
Declaration
Swift
public let imageSource: URL -
The user specified type of the tile (if specified)
Declaration
Swift
public var type: String? -
Any user defined properties associated with the tile
Declaration
Swift
public var properties: Properties -
The color used in the image that should be treated as transparent (if any). This should not impact the interpretation of any alpha values also used for a color (i.e. it is addative)
Declaration
Swift
public let transparentColor: Color? -
The rectangle within the image that should be used to as the final
Tileimage. This enables a single image source to contain multipleTileimagesDeclaration
Swift
public let bounds: PixelBounds -
A unique identifier for the tile (where unique means another
Tilewith the sameboundswould have the same uuidDeclaration
Swift
public var uuid: String { get } -
Creates a new instance of a tile
Declaration
Swift
public init(_ imageSource: URL, bounds: PixelBounds, transparentColor: Color? = nil)Parameters
imageSourceThe
URLof the image the tile is or is inboundsThe portion of the speciied image that should be used for the tile. If the whole image should be used, it will be a point with an origin of
Point.zeroand a size the same as the source imagetransparentColorThe color in the image that should be treated as transparent (defaults to
nilas modern formats typically contain alpha) -
Compares two tiles to determine if they are equivalent
Declaration
Swift
public static func == (lhs: Tile, rhs: Tile) -> BoolParameters
lhsThe first
TilerhsThe second
TileReturn Value
trueif they are the samefalseotherwise
View on GitHub
Tile Class Reference