API Docs for: 6.0.1
Show:

window.scrawl_SaveLoad Class

window.scrawl

scrawlSaveLoad extension adaptions to the scrawl-canvas library object

Methods

Base.toString

()

Turn the object into a JSON String

Returns:

JSON string of non-default value attributes

Cell.toString

(
  • [noexternalobjects]
)

Turn the object into a JSON String

Parameters:

  • [noexternalobjects] Boolean optional

    True to exclude external objects such as entitys, designs and groups

Returns:

Array of JSON strings of non-default value attributes

Context.toString

()

Turn the object into a JSON String; doesn't include name and type attributes

Returns:

JSON string of non-default value attributes

Entity.toString

()

Turn the object into a JSON String

Returns:

JSON string of non-default value attributes, including non-default context values

Group.save

()

Turn the object into a JSON String

Retains the entitys attribute Array; does not include any other objects in the return Array

Returns:

Array of JSON Strings

Group.toString

(
  • [noentitys]
)

Turn the object into a JSON String

Automatically removes the entitys attribute from the result; when loading, existing entitys need to be re-added to the group

Parameters:

  • [noentitys] Boolean optional

    True to exclude the entitys attribute; false will return an array containing this and each of the entitys in the entitys array

Returns:

Array of JSON strings of non-default value attributes

load

(
  • item
)

A load function

Argument should be a JSON String, or an Array of JSON Strings, of objects to be loaded or updated

Parameters:

  • item Array

    Array of JSON Strings; alternatively, a JSON String

Returns:

Always true

Pad.toString

(
  • [noexternalobjects]
)

Turn the object into a JSON String

Parameters:

  • [noexternalobjects] Boolean optional

    True to exclude external objects such as entitys, designs and groups

Returns:

Array of JSON strings of non-default value attributes

PageElement.toString

()

Turn the object into a JSON String

Returns:

JSON string of non-default value attributes

Position.toString

()

Turn the object into a JSON String

Returns:

JSON string of non-default value attributes

save

(
  • item
)

A save function

Argument should be a String literal: 'pads', 'cells', 'groups', 'entitys', 'designs', 'spriteanimations', 'springs'

Note: this function does not check for duplicate objects

Parameters:

  • item String

    A String literal

Returns:

Array of saved data