-
Notifications
You must be signed in to change notification settings - Fork 78
Util (library)
The Love Frames util library houses various functions, most of which are meant for internal use by Love Frames only.
Sets the active skin
loveframes.util.SetActiveSkin(name[string])
Gets the active skin
Returns 1 value: active skin [string]
local activeskin = loveframes.util.GetActiveSkin()
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)
Get what objects the mouse cursor is colliding with
Returns 1 value: objects [table]
local cols = loveframes.util.GetCollisions(object, t)
Gets all active Love Frames objects
Returns 1 value: objects [table]
local objects = loveframes.util.GetAllObjects(object, t)
Gets the contents of a directory recursively
Returns 1 value: directory contents [table]
local contents = loveframes.util.GetDirectoryContents(dir, t)
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)
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)
Removes all active Love Frames objects
loveframes.util.RemoveAll()
Checks to see if a table has a specific key
Returns 1 value: haskey [boolean]
local haskey = loveframes.util.TableHasKey(table, key)
Displays an error message as a Love Frames error
loveframes.util.Error(message)
Gets the total number Love Frames objects colliding with the mouse
Returns 1 value: collisioncount [number]
local colcount = loveframes.util.GetCollisionCount()
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()
Checks for collisions between two rectangles
Returns 1 value: collision [boolean]
local col = loveframes.util.RectangleCollisionCheck(rect1[table], rect2[table])
Copies a table
Returns 1 value: newtable [table]
local newtable = loveframes.util.DeepCopy(original_table[table])