Screen effects made simple
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
game.png
main.lua
shack.lua

README.md

shack

shack is a LÖVE library that lets you easily add screen effects such as shake and rotation.

demo

Setup

Require the library

local screen = require "shack"

Set game dimensions

screen:setDimensions(width, height) --love.graphics.getDimensions() by default

For push users:

screen:setDimensions(push:getDimensions())

Usage

Update shack

function love.update(dt)
  screen:update(dt)
end

Apply effects

function love.draw()
  screen:apply()
  
  --draw after applying
end

Shake screen

screen:setShake(20)

Methods and aliases

Set dimensions

screen:setDimensions(width, height)

Update shack

screen:update(dt)

Apply shack

screen:apply()

Set/get shake intensity

screen:setShake(shake)
//-> screen:shake

screen:getShake()

Set/get rotation

screen:setRotation(rotation)
//-> screen:rotate

screen:getRotation()

Set/get scale intensity

screen:setScale(x, y)
//-> screen:zoom

screen:getScale()

Set/get shear intensity

screen:setShear(x, y)
//-> screen:tilt

screen:getShear()

Set/get shake target

screen:setShakeTarget(shakeTarget) --defaults to 0

screen:getShakeTarget()

Set/get rotation target

screen:setRotationTarget(rotationTarget) --defaults to 0

screen:getRotationTarget()

Set/get scale target

screen:setScaleTarget(x, y) --defaults to 1, 1

screen:getScaleTarget()

Set/get shear target

screen:setShearTarget(x, y) --defaults to 0, 0

screen:getShearTarget()