# Nirvana2D [RCBasic Doc]

## Nirvana2D Background API

Function Nirvana_GetLayerBackgroundImageID(layer_index)

- Returns the RCBasic image id of the image set on the given layer or -1 if no image is set

Function Nirvana_SetLayerBackgroundImage(layer_index, image_id)

- Sets a new image on the given layer (NOTE: Layer must be a Canvas2D layer)

Function Nirvana_GetLayerBackgroundRenderType(layer_index)

- Returns the render type of the layer image set in Nirvana2D
- Possible Render Types
  - NIRVANA_IMG_RENDER_SETTING_NORMAL
  - NIRVANA_IMG_RENDER_SETTING_STRETCHED
  - NIRVANA_IMG_RENDER_SETTING_TILED

Function Nirvana_SetLayerBackgroundRenderType(layer_index, render_type)

- Sets the render type of the layer image (NOTE: Layer must be a Canvas2D layer)
- Possible Render Types
  - NIRVANA_IMG_RENDER_SETTING_NORMAL
  - NIRVANA_IMG_RENDER_SETTING_STRETCHED
  - NIRVANA_IMG_RENDER_SETTING_TILED