core package

core contains no utilities.

License

The core package is marked as Compatible, which means any game can use it.

Classes

Object

Object is the class that all other classes implicitly inherit from. This means that the below functions can be relied upon to exist for any object.

answer = object:IsA(name)
Returns true if object either inherits from or is an instance of class name. In particular, all objects will return true for IsA("Object").
class[, superclass [, ...]] = object:Identity()
Returns the class name of object, followed by its superclass, and its superclass's superclass, etc. until it reaches Object. This is suitable for passing directly to print for debugging purposes.

Path

Path contains a platform-specific path. It powers SubCritical.ConstructPath, and should not be constructed directly. (It might be useful to directly construct a path for debugging purposes to access a file whose absolute location on your system is known, such as a system font.)

path = SubCritical.Construct("Path", raw_path)
Please use SubCritical.ConstructPath instead.
raw_path = path:GetPath()
Returns the "raw" platform-specific path. You normally do not need this function, since io.open is encapsulated by SubCritical.
filename = path:GetFilename()
Returns only the filename portion of this path. This is more useful than the above, especially when dealing with a path you didn't hardcode (such as one from a directory listing).

Back to index