CPTileMapper

org.cosplay.CPTileMapper$
object CPTileMapper

Utility that provides tile mapping functionality.

Attributes

Example

See CPTileMapperExample class for the example of using tile mapper.

Source
CPTileMapper.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def layout(x: Int, y: Int, map: CPImage, tileDim: CPDim, mapping: (CPPosPixel, Int, Int) => Option[CPSceneObject]): List[CPSceneObject]

Given tile map and individual tile dimension this method lays out the tiles and returns the list of scene objects representing the tile map. A tile map is an image where each pixel can be mapped into a scene object using mapping function.

Given tile map and individual tile dimension this method lays out the tiles and returns the list of scene objects representing the tile map. A tile map is an image where each pixel can be mapped into a scene object using mapping function.

Value parameters

map

An image representing the tile map.

mapping

Mapping function that takes a pixel and its coordinates from the tile map and returns a scene object that should represent that tile.

tileDim

The dimension of the individual tile. Note that all tiles will have to be of the same dimension.

x

X-coordinate of the initial tile.

y

Y-coordinate of the initial tile.

Attributes

Source
CPTileMapper.scala