API Docs for: 6.0.1
Show:

FramePoint Class

Extends Base
Module: scrawlFrame

FramePoint

Instantiation

  • scrawl.makeFramePoint()

Purpose

  • Defines the corner points for a Frame entity

Access

  • none - like Vectors, only stored locally

Constructor

FramePoint

(
  • [items]
)

Parameters:

  • [items] Object optional

    Key:value Object argument for setting attributes

Methods

clone

(
  • items
)
chainable

Clone a Scrawl.js object, optionally altering attribute values in the cloned object

Note that any callback or fn attribute functions will be referenced by the clone, not copied to the clone; these can be overwritten with new anonymous functions by including them in the items argument object

(This function is replaced by the path extension)

Parameters:

  • items Object

    Object containing attribute key:value pairs; will overwrite existing values in the cloned, but not the source, Object

Returns:

Cloned object

Example:

var box = scrawl.makeBlock({
    width: 50,
    height: 50
    });
var newBox = box.clone({
    height: 100
    });
newBox.get('width');        //returns 50
newBox.get('height');       //returns 100

get

(
  • item
)

Inherited from Base but overwritten in source\scrawlFrame.js:243

Parameters:

  • item String

    Name of attribute to return

Returns:

attribute

numberConvert

(
  • val
  • dim
)
private

Stamp helper function - convert string percentage values to numerical values

Parameters:

  • val String

    coordinate String

  • dim Number

    dimension value

Returns:

Number - value

parse

()

Turn the object into a JSON String

Returns:

object of object's currently set attributes

set

(
  • items
)
chainable

Inherited from Base but overwritten in source\scrawlFrame.js:251

Parameters:

  • items Object

    Object consisting of key:value attributes

Returns:

This

setLocal

() private chainable

Update the local positioning vector

Returns:

This

setLocalFromData

() private chainable

setLocal() helper function - position supplied in data array

Data should always be an array in the form [x, y, z]

Returns:

This

setLocalFromDataString

(
  • item
  • dimension
)
private chainable

setLocalFromData() helper function - convert percentage/literal strings to numeric values

Parameters:

  • item String

    percentage string or string position value

  • dimension Number

    Host's cell's actualWidth or actualHeight

Returns:

Number calculated position value

setLocalFromPath

() private chainable

setLocal() helper function - position supplied by Path entity

Returns:

This

setReference

() private chainable

Funtion to set the reference attribute - a string flag to inform the code where the positioning data will originate:

  • data - user/code will supply position through a position array
  • lock - position determined by a corner div within a positioning element in a stack
  • entity, cell, point, stack, pad, element, particle - positioned using a pivot or path; string value defines which part of the Scrawl library the pivot or path will be found

Returns:

This

Properties

comment

String

Comment, for accessibility

Default: ''

data

Array - consisting of x, y, z coordinates private

Data should always be an array in the form [x, y, z]

Default: false

data

String private

reference - defines how, and from where, the local coordinates for this FramePoint will be calculated

Permitted values include: 'data', 'lock', 'entity', 'cell', 'point', 'stack', 'pad', 'element', 'particle'

Default: false

deltaPathPlace

Number

A change value which can be applied to the object's pathPlace attribute

Default: false

host

String - FRAMENAME String of the host frame private

Frame emtity to which this frame corner belongs

Default: false

local

Vector - current coordinates for this FramePoint's position private

Default: Object - {x:0, y:0, z:0}

lock

Boolean - true if host Frame is using a Stack Element for positioning; false otherwise private

Default: false

lockCorner

String - if lock == true, will be set to one of four values: 'topLeft', 'topRight', 'bottomRight', 'bottomLeft' private

Default: false

lockX

Boolean

Positioning flag; set to true to ignore path/pivot/mouse changes along the X axis

Default: false

lockY

Boolean

Positioning flag; set to true to ignore path/pivot/mouse changes along the Y axis

Default: false

name

String

Unique identifier for each object; default: computer-generated String based on Object's type

path

String

The ENTITYNAME of a Path entity whose path is used to calculate this object's start point

Default: false

pathPlace

Number

A value between 0 and 1 to represent the distance along a Path object's path, where 0 is the path start and 1 is the path end

Default: false

pathSpeedConstant

Boolean

A flag to determine whether the object will calculate its position along a Shape path in a regular (true), or simple (false), manner

Default: false

pivot

String - ENTITYNAME, CELLNAME etc of object FramePoint will use as its pivot private

Default: false

timestamp

String

Creation timestamp

Default: ''

title

String

Title, for accessibility

Default: ''

type

String final

Inherited from Base but overwritten in source\scrawlFrame.js:132

Default: 'FramePoint'