LightingModel
Type | LightingModel |
Library | wattageTileEngine.* |
Keywords | Wattage, LightingModel, Tile Engine |
See also |
Overview
The lighting model tracks lighting of the tiles.
Syntax
local TileEngine = require "plugin.wattageTileEngine"
-- Callback to indicate whether light can pass through a tile
local function isTransparentForLight(column, row)
-- Make an opaque wall along column 5
return column ~= 5
end
-- Callback to indicate whether a tile is affected by ambient lighting.
local function isTileAffectedByAmbient(row, column)
-- Make all tiles affected by ambient lighting
return true
end
local lightingModel = TileEngine.LightingModel.new({
isTransparent = isTransparentForLight,
isTileAffectedByAmbient = isTileAffectedByAmbient,
useTransitioners = true,
compensateLightingForViewingPosition = false
})