Home

Module bkg

Lua bindings to interact with the background.

An example would be:

 
`

Functions

clear () Clears any backgrounds that may currently be displaying.
image (image, x, y, move, scale[, col[, foreground=false]]) Adds a background image.


Functions

clear ()
Clears any backgrounds that may currently be displaying. ()
image (image, x, y, move, scale[, col[, foreground=false]])
Adds a background image.

If the colour parameter is a boolean it's treated as the foreground parameter instead. ( image, x, y, move, scale, col, foreground )

Parameters:

  • image Tex Image to use.
  • x number X position.
  • y number Y position.
  • move number Fraction of a pixel to move when the player moves one pixel.
  • scale number How much to scale the image.
  • col Colour Colour to tint image. (optional)
  • foreground boolean Whether or not it should be rendered above the stars. (default false)

Returns:

    number ID of the background.

Usage:

  • bkg.image( img, 0, 0, 0.1, 1. ) -- Adds the image without scaling that moves at 0.1 the player speed
  • bkg.image( img, 0, 0, 0.1, 1., true ) -- Now on the foreground
  • bkg.image( img, 0, 0, 0.1, 1., col.new(1,0,0) ) -- Now with colour
  • bkg.image( img, 0, 0, 0.1, 1., col.new(1,0,0), true ) -- Now with colour and on the foreground
generated by LDoc 1.4.3 Last updated 2020-02-20 05:27:49