wiki.sine.space | sinespace

Scripting/SPhotos

From wiki.sine.space
Revision as of 11:08, 25 January 2022 by Voidtech (Talk | contribs) (Created page with " =Public Member Functions= {{ScriptFunction|void|OpenUploadFileBrowser|();|Opens a window that let's you select a file you wish to upload.|5=<pre>Space.Photos.OpenUploadFileB...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Public Member Functions

OpenUploadFileBrowser

void OpenUploadFileBrowser ();

Opens a window that let's you select a file you wish to upload.

Space.Photos.OpenUploadFileBrowser()


--this script will open a file upload browser when clicked
thisObject = Space.Host.ExecutingObject

function OnClickFunction()
Space.Photos.OpenUploadFileBrowser()
end


thisObject.AddClickable()
thisObject.Clickable.Tooltip = "Click me to upload photo"
thisObject.Clickable.OnClick(OnClickFunction)

OnUploadStart

void OnUploadStart (closure c);

Binds the function c to be called when an upload operation begins.

Space.Photos.OpenUploadFileBrowser()


--this script will show a text on screen that says "Uploading..." when a photo upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."

function OnUploadStartFunction()
textObject.Active = true
end

function OnUploadEndFunction()
textObject.Active = false
end

Space.Photos.OnUploadStart(OnUploadStartFunction)
Space.Photos.OnUploadEnd(OnUploadEndFunction)

OnUploadEnd

void OnUploadEnd (closure c);

Binds the function c to be called when an upload operation ends.

Space.Photos.OpenUploadFileBrowser()


--this script will show a text on screen that says "Uploading..." when a photo upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."

function OnUploadStartFunction()
textObject.Active = true
end

function OnUploadEndFunction()
textObject.Active = false
end

Space.Photos.OnUploadStart(OnUploadStartFunction)
Space.Photos.OnUploadEnd(OnUploadEndFunction)