Skip to content
Aaron H edited this page Nov 29, 2016 · 1 revision

Information

The Love Frames util library houses various functions, most of which are meant for internal use by Love Frames only.

Functions

SetActiveSkin

Sets the active skin

loveframes.util.SetActiveSkin(name[string])

GetActiveSkin

Gets the active skin

Returns 1 value: active skin [string]

local activeskin = loveframes.util.GetActiveSkin()

BoundingBox

Used to check for collisions of two rectangles

Note: I take no credit for this function

Returns 1 value: collision [boolean]

local col = loveframes.util.BoundingBox(x1, x2, y1, y2, w1, w2, h1, h2)

GetCollisions

Get what objects the mouse cursor is colliding with

Returns 1 value: objects [table]

local cols = loveframes.util.GetCollisions(object, t)

GetAllObjects

Gets all active Love Frames objects

Returns 1 value: objects [table]

local objects = loveframes.util.GetAllObjects(object, t)

GetDirectoryContents

Gets the contents of a directory recursively

Returns 1 value: directory contents [table]

local contents = loveframes.util.GetDirectoryContents(dir, t)

Round

Used to round numbers

Note: I take no credit for this function

Returns 1 value: rounded number [number]

local roundednumber = loveframes.util.Round(num, idp)

SplitString

Splits a string into a table by the given pattern

Note: I take no credit for this function

Returns 1 value: table [table]

local table = loveframes.util.SplitString(str, pat)

RemoveAll

Removes all active Love Frames objects

loveframes.util.RemoveAll()

TableHasKey

Checks to see if a table has a specific key

Returns 1 value: haskey [boolean]

local haskey = loveframes.util.TableHasKey(table, key)

Error

Displays an error message as a Love Frames error

loveframes.util.Error(message)

GetCollisionCount

Gets the total number Love Frames objects colliding with the mouse

Returns 1 value: collisioncount [number]

local colcount = loveframes.util.GetCollisionCount()

GetHover

Returns true if the mouse is colliding with a visible Love Frames objetct, false if not

Returns 1 value: hover [boolean]

local hover = loveframes.util.GetHover()

RectangleCollisionCheck

Checks for collisions between two rectangles

Returns 1 value: collision [boolean]

local col = loveframes.util.RectangleCollisionCheck(rect1[table], rect2[table])

DeepCopy

Copies a table

Returns 1 value: newtable [table]

local newtable = loveframes.util.DeepCopy(original_table[table])