Blockly.Events. ViewportChange
Constructor
ViewportChange
new ViewportChange(opt_top, opt_left, opt_scale, opt_workspaceId)
Class for a viewport change event.
Parameter |
|
---|---|
opt_top |
Optional number Top-edge of the visible portion of the workspace, relative to the workspace origin. Undefined for a blank event. |
opt_left |
Optional number Left-edge of the visible portion of the workspace, relative to the workspace origin. Undefined for a blank event. |
opt_scale |
Optional number The scale of the workspace. Undefined for a blank event. |
opt_workspaceId |
Optional string The workspace identifier for this event. Undefined for a blank event. |
- Extends
- Blockly.Events.UiBase
Properties
group
unknown
The event group id for the group this event belongs to. Groups define events that should be treated as an single action from the user's perspective, and should be undone together.
- Inherited from
- Blockly.Events.Abstract#group
isBlank
unknown
Whether or not the event is blank (to be populated by fromJson).
- Inherited from
- Blockly.Events.UiBase#isBlank
isUiEvent
unknown
Whether or not the event is a UI event.
- Inherited from
- Blockly.Events.UiBase#isUiEvent
recordUndo
unknown
Sets whether the event should be added to the undo stack.
- Inherited from
- Blockly.Events.Abstract#recordUndo
scale
(number or undefined)
The scale of the workspace.
type
string
Type of this event.
viewLeft
(number or undefined)
Left-edge of the visible portion of the workspace, relative to the workspace origin.
viewTop
(number or undefined)
Top-edge of the visible portion of the workspace, relative to the workspace origin.
workspaceId
unknown
The workspace identifier for this event.
- Inherited from
- Blockly.Events.UiBase#workspaceId
Methods
fromJson
fromJson(json)
Decode the JSON event.
Parameter |
|
---|---|
json |
Object JSON representation. Value must not be null. |
getEventWorkspace_
getEventWorkspace_() returns Blockly.Workspace
Get workspace the event belongs to.
- Inherited from
- Blockly.Events.Abstract#getEventWorkspace_
- Throws
-
if workspace is null.
- Returns
-
The workspace the event belongs to.
isNull
isNull() returns boolean
Does this event record any change of state?
- Inherited from
- Blockly.Events.Abstract#isNull
- Returns
-
True if null, false if something changed.
run
run(_forward)
Run an event.
Parameter |
|
---|---|
_forward |
True if run forward, false if run backward (undo). |
- Inherited from
- Blockly.Events.Abstract#run
toJson
toJson() returns Object
Encode the event as JSON.
- Returns
-
non-null Object
JSON representation.