Raw Documentation

This page contains documentation for all PhotonFramework methods and service Methods.

Main methods:

PhotonFramework

PhotonFramework:Start()

This method must be called before any interaction is done with the framework, as it prepares all aspects of it.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PhotonFramework = ReplicatedStorage:WaitForChild("PhotonFramework"):WaitForChild("PhotonFramework")
PhotonFramework:Start()

PhotonFramework.Objects

The Objects subtable is used to interact with both built-in objects and custom-made objects.

PhotonFramework.Objects:NewClass(ClassName:string,Class:table)

This method is used to create a new class, which can then be interacted with via the PhotonFramework.Objects:GetClass method.

PhotonFramework.Objects:NewClass("Demo Class",require(path.to.class))

PhotonFramework.Objects:GetClass(ClassName:string)

This method can be used to get the stored class data for any class that has been added to the framework (internal, custom, etc).

PhotonFramework.Objects:AssignClass(Object:instance,ClassName:string)

This method is used to bind and construct a class with the supplied object.

The class will have the .new method called, and with the supplied object passed as the only argument.

PhotonFramework.Objects:GetObjectClass(Object:instance)

This method will return the class bound to the object via the PhotonFramework.Objects:AssignClass method.

PhotonFramework.Services

The services subtable is used to interact with services within the framework, both custom and built-in.

PhotonFramework.Services:GetService(ServiceName:string)

This method can be used to get a service from the framework, either a built-in one or custom one.

PhotonFramework.Services:CreateService(ServiceName:string,Service:table,BootState:bool)

This method can be used to create a custom service within the framework.

Services:

CalculationService

CalculationService is a service that's purpose is to make physics-based calculations within the engine easy to do.

CalculationService:GetProjectileMotionAtTime(timeValue:number,projectileInitialPosition:Vector3,projectileInitialVelocity:Vector3)

This method will return the position of a theoretical (since there is no actual projectile passed in the arguments) position at x time (timeValue). This can be used to model a projectile's path effectively.

InstanceService

InstanceService allows for easy instance creation, while it does not contain much, it's the backbone of some more complex services.

InstanceService:Create(ClassName:string,Properties:any,Callback)

This method will create an instance with a set of defined properties, and a callback if supplied.

SharedService

SharedService allows for data to be easily synced across multiple scripts. It's a big table basically.

SharedService:GetValue(key:any)

This is used to retrieve a value from the service.

SharedService:SetValue(key:any,value:any)

This is used to store a value in the service.

UIService

This service can be used to create advanced UIs easily with scripts.

UIService:Create(ClassType:string)

This method can be used to create a UIService tree, which contains data to render a GUI.

UIService:Object(object:string,properties:table,children:table,connections:table,callback)

This method is used to create a UI object (such as a text button), which can then be added to a UI tree.

UIService:Add(object:instance,tree:table)

This method is used to add an object to a UI tree.

UIService:Render(container:Instance,tree:table)

This method is used to render a UI tree.

UUIDService

UUIDService is a service that allows the creation of a unique string (for said server, does not save).

UUIDService:GenerateUUID(length:number)

This method generates a random, unique string that is the supplied length long.

UUIDService:GenerateUUIDCustomCharacters(length:number,characters:table)

This method generates a string of characters from a custom list.

This concludes the API documentation for now.

Last updated