Description

Obtain the cells where the entity. Return this object (example) :

{
    cells: [{
        col: 1,
        row: 1
    }]
}   

Usage

Parameters

  • entity {Entity|EntityModel}

Returns

Object

Example

In ready method

var entity = Class.New("Entity", [stage]),
    pos = entity.position();

var grid = Class.New("Grid", [2, 2]);

grid.setCellSize(32, 32);

grid.getEntityCells(entity); 

// => returns 
/*
{
    cells: [{
        col: 0,
        row: 0
    }]
}   

Discussion