namespace + component updates
parent
8d3554b46b
commit
e668c15c70
|
@ -9,5 +9,6 @@ r3 create SystemLinking system
|
|||
r3 create SystemTest system
|
||||
r3 create Component extends R3Object ./r3-component/
|
||||
r3 create Image extends Component ./r3-component/
|
||||
r3 create Runtime extends Event
|
||||
r3 create SystemInput system
|
||||
r3 create Input extends Component ./r3-component/
|
||||
r3 create Touch extends Input ./r3-component/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class R3 {
|
||||
static version = '2.0.176';
|
||||
static compileDate = '2021 Sep 06 - 13:04:25 pm';
|
||||
static version = '2.0.185';
|
||||
static compileDate = '2021 Sep 07 - 07:56:14 am';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -272,24 +272,25 @@ Event.DISPOSE_INSTANCE = 0x3;
|
|||
Event.DISPOSE_OBJECT = 0x4;
|
||||
Event.GET_RUNTIME = 0x5;
|
||||
Event.GET_WINDOW_SIZE = 0x6;
|
||||
Event.INSTANCE_CREATED = 0x7;
|
||||
Event.INSTANCE_DISPOSED = 0x8;
|
||||
Event.KEYBOARD_DOWN = 0x9;
|
||||
Event.KEYBOARD_UP = 0xa;
|
||||
Event.MOUSE_DOWN = 0xb;
|
||||
Event.MOUSE_MOVE = 0xc;
|
||||
Event.MOUSE_UP = 0xd;
|
||||
Event.MOUSE_WHEEL = 0xe;
|
||||
Event.OBJECT_CREATED = 0xf;
|
||||
Event.OBJECT_INITIALIZED = 0x10;
|
||||
Event.PAUSE = 0x11;
|
||||
Event.RESTART = 0x12;
|
||||
Event.START = 0x13;
|
||||
Event.TOUCH_CANCEL = 0x14;
|
||||
Event.TOUCH_END = 0x15;
|
||||
Event.TOUCH_MOVE = 0x16;
|
||||
Event.TOUCH_START = 0x17;
|
||||
Event.MAX_EVENTS = 0x18;
|
||||
Event.INPUT_COMPONENT_INITIALIZED = 0x7;
|
||||
Event.INSTANCE_CREATED = 0x8;
|
||||
Event.INSTANCE_DISPOSED = 0x9;
|
||||
Event.KEYBOARD_DOWN = 0xa;
|
||||
Event.KEYBOARD_UP = 0xb;
|
||||
Event.MOUSE_DOWN = 0xc;
|
||||
Event.MOUSE_MOVE = 0xd;
|
||||
Event.MOUSE_UP = 0xe;
|
||||
Event.MOUSE_WHEEL = 0xf;
|
||||
Event.OBJECT_CREATED = 0x10;
|
||||
Event.OBJECT_INITIALIZED = 0x11;
|
||||
Event.PAUSE = 0x12;
|
||||
Event.RESTART = 0x13;
|
||||
Event.START = 0x14;
|
||||
Event.TOUCH_CANCEL = 0x15;
|
||||
Event.TOUCH_END = 0x16;
|
||||
Event.TOUCH_MOVE = 0x17;
|
||||
Event.TOUCH_START = 0x18;
|
||||
Event.MAX_EVENTS = 0x19;
|
||||
|
||||
Event.GetEventName = function(eventId) {
|
||||
|
||||
|
@ -300,23 +301,24 @@ Event.GetEventName = function(eventId) {
|
|||
case 0x4 : return 'dispose_object';
|
||||
case 0x5 : return 'get_runtime';
|
||||
case 0x6 : return 'get_window_size';
|
||||
case 0x7 : return 'instance_created';
|
||||
case 0x8 : return 'instance_disposed';
|
||||
case 0x9 : return 'keyboard_down';
|
||||
case 0xa : return 'keyboard_up';
|
||||
case 0xb : return 'mouse_down';
|
||||
case 0xc : return 'mouse_move';
|
||||
case 0xd : return 'mouse_up';
|
||||
case 0xe : return 'mouse_wheel';
|
||||
case 0xf : return 'object_created';
|
||||
case 0x10 : return 'object_initialized';
|
||||
case 0x11 : return 'pause';
|
||||
case 0x12 : return 'restart';
|
||||
case 0x13 : return 'start';
|
||||
case 0x14 : return 'touch_cancel';
|
||||
case 0x15 : return 'touch_end';
|
||||
case 0x16 : return 'touch_move';
|
||||
case 0x17 : return 'touch_start';
|
||||
case 0x7 : return 'input_component_initialized';
|
||||
case 0x8 : return 'instance_created';
|
||||
case 0x9 : return 'instance_disposed';
|
||||
case 0xa : return 'keyboard_down';
|
||||
case 0xb : return 'keyboard_up';
|
||||
case 0xc : return 'mouse_down';
|
||||
case 0xd : return 'mouse_move';
|
||||
case 0xe : return 'mouse_up';
|
||||
case 0xf : return 'mouse_wheel';
|
||||
case 0x10 : return 'object_created';
|
||||
case 0x11 : return 'object_initialized';
|
||||
case 0x12 : return 'pause';
|
||||
case 0x13 : return 'restart';
|
||||
case 0x14 : return 'start';
|
||||
case 0x15 : return 'touch_cancel';
|
||||
case 0x16 : return 'touch_end';
|
||||
case 0x17 : return 'touch_move';
|
||||
case 0x18 : return 'touch_start';
|
||||
default :
|
||||
throw new Error('Event type not defined : ' + eventId);
|
||||
}
|
||||
|
@ -2368,92 +2370,6 @@ class R3Object extends Event {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Class R3.Event.Runtime
|
||||
[Inherited from Event]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
<no inherited properties>
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Async()' passing it the arguments
|
||||
|
||||
- emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Emit()' passing it the arguments
|
||||
|
||||
- subscribe(eventId, callback)
|
||||
Simply calls 'Subscribe()' passing it the arguments
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
- Async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
|
||||
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
|
||||
error as argument.
|
||||
|
||||
- Emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
|
||||
the event result is obtained, passing it the result. If an exception occurs during execution, the
|
||||
clientErrorCallback is called with the error as argument.
|
||||
|
||||
- Subscribe(eventId, callback)
|
||||
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
|
||||
|
||||
[Belonging to Runtime]
|
||||
|
||||
Properties:
|
||||
|
||||
<no properties>
|
||||
|
||||
Static Properties:
|
||||
|
||||
<no static properties>
|
||||
|
||||
Methods:
|
||||
|
||||
<no methods>
|
||||
|
||||
Static Methods:
|
||||
|
||||
<no static methods>
|
||||
|
||||
Of the form x=<value>
|
||||
|
||||
Of the form x=<instance.property>
|
||||
|
||||
**/
|
||||
|
||||
class Runtime extends Event {
|
||||
|
||||
constructor(options) {
|
||||
|
||||
if (typeof options === 'undefined') {
|
||||
options = {};
|
||||
}
|
||||
|
||||
super(options);
|
||||
|
||||
this.emit(Event.OBJECT_CREATED, this);
|
||||
|
||||
Object.assign(this, options);
|
||||
|
||||
this.emit(Event.OBJECT_INITIALIZED, this);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Runtime.DEFAULT = 0x1;
|
||||
Runtime.GRAPHICS = 0x2;
|
||||
|
||||
/**
|
||||
|
||||
Class R3.Event.Object.Component
|
||||
|
@ -2864,20 +2780,308 @@ class Image extends Component {
|
|||
|
||||
}
|
||||
|
||||
R3.Object = R3Object;
|
||||
R3.Component = Component;
|
||||
/**
|
||||
|
||||
Class R3.Event.Object.Component.Input
|
||||
[Inherited from Event]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
<no inherited properties>
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Async()' passing it the arguments
|
||||
|
||||
- emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Emit()' passing it the arguments
|
||||
|
||||
- subscribe(eventId, callback)
|
||||
Simply calls 'Subscribe()' passing it the arguments
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
- Async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
|
||||
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
|
||||
error as argument.
|
||||
|
||||
- Emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
|
||||
the event result is obtained, passing it the result. If an exception occurs during execution, the
|
||||
clientErrorCallback is called with the error as argument.
|
||||
|
||||
- Subscribe(eventId, callback)
|
||||
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
|
||||
|
||||
[Inherited from R3Object]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- register (Default value true)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
<no inherited methods>
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Inherited from Component]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- runtime (Default value R3.Runtime.DEFAULT)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- createInstance()
|
||||
No comment
|
||||
|
||||
- dispose()
|
||||
No comment
|
||||
|
||||
- disposeInstance()
|
||||
No comment
|
||||
|
||||
- getRuntime()
|
||||
No comment
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Belonging to Input]
|
||||
|
||||
Properties:
|
||||
|
||||
<no properties>
|
||||
|
||||
Static Properties:
|
||||
|
||||
<no static properties>
|
||||
|
||||
Methods:
|
||||
|
||||
<no methods>
|
||||
|
||||
Static Methods:
|
||||
|
||||
<no static methods>
|
||||
|
||||
Of the form x=<value>
|
||||
|
||||
Of the form x=<instance.property>
|
||||
|
||||
**/
|
||||
|
||||
class Input extends Component {
|
||||
|
||||
constructor(options) {
|
||||
|
||||
if (typeof options === 'undefined') {
|
||||
options = {};
|
||||
}
|
||||
|
||||
super(options);
|
||||
|
||||
this.emit(Event.OBJECT_CREATED, this);
|
||||
|
||||
Object.assign(this, options);
|
||||
|
||||
this.emit(Event.OBJECT_INITIALIZED, this);
|
||||
|
||||
this.emit(Event.INPUT_COMPONENT_INITIALIZED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Class R3.Event.Object.Component.Input.Touch
|
||||
[Inherited from Event]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
<no inherited properties>
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Async()' passing it the arguments
|
||||
|
||||
- emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Emit()' passing it the arguments
|
||||
|
||||
- subscribe(eventId, callback)
|
||||
Simply calls 'Subscribe()' passing it the arguments
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
- Async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
|
||||
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
|
||||
error as argument.
|
||||
|
||||
- Emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
|
||||
the event result is obtained, passing it the result. If an exception occurs during execution, the
|
||||
clientErrorCallback is called with the error as argument.
|
||||
|
||||
- Subscribe(eventId, callback)
|
||||
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
|
||||
|
||||
[Inherited from R3Object]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- register (Default value true)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
<no inherited methods>
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Inherited from Component]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- runtime (Default value R3.Runtime.DEFAULT)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- createInstance()
|
||||
No comment
|
||||
|
||||
- dispose()
|
||||
No comment
|
||||
|
||||
- disposeInstance()
|
||||
No comment
|
||||
|
||||
- getRuntime()
|
||||
No comment
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Inherited from Input]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
<no inherited properties>
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
<no inherited methods>
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Belonging to Touch]
|
||||
|
||||
Properties:
|
||||
|
||||
<no properties>
|
||||
|
||||
Static Properties:
|
||||
|
||||
<no static properties>
|
||||
|
||||
Methods:
|
||||
|
||||
<no methods>
|
||||
|
||||
Static Methods:
|
||||
|
||||
<no static methods>
|
||||
|
||||
Of the form x=<value>
|
||||
|
||||
Of the form x=<instance.property>
|
||||
|
||||
**/
|
||||
|
||||
class Touch extends Input {
|
||||
|
||||
constructor(options) {
|
||||
|
||||
if (typeof options === 'undefined') {
|
||||
options = {};
|
||||
}
|
||||
|
||||
super(options);
|
||||
|
||||
this.emit(Event.OBJECT_CREATED, this);
|
||||
|
||||
Object.assign(this, options);
|
||||
|
||||
this.emit(Event.OBJECT_INITIALIZED, this);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
R3.System = System;
|
||||
R3.Event = Event;
|
||||
R3.Utils = Utils;
|
||||
R3.System.Input = SystemInput;
|
||||
R3.System.Linking = SystemLinking;
|
||||
R3.System.Socket = SystemSocket;
|
||||
R3.System.Test = SystemTest;
|
||||
R3.Event = Event;
|
||||
R3.Event.Object = R3Object;
|
||||
R3.Event.Runtime = Runtime;
|
||||
R3.Event.Object.Component = Component;
|
||||
R3.Event.Object.Project = Project;
|
||||
R3.Event.Object.Component.Image = Image;
|
||||
R3.Event.Component = Component;
|
||||
R3.Event.Image = Image;
|
||||
R3.Event.Input = Input;
|
||||
R3.Event.Touch = Touch;
|
||||
R3.Event.Project = Project;
|
||||
R3.Utils = Utils;
|
||||
R3.Object = R3Object;
|
||||
R3.Object.Component = Component;
|
||||
R3.Object.Image = Image;
|
||||
R3.Object.Input = Input;
|
||||
R3.Object.Touch = Touch;
|
||||
R3.Object.Project = Project;
|
||||
R3.Component = Component;
|
||||
R3.Component.Image = Image;
|
||||
R3.Component.Input = Input;
|
||||
R3.Component.Touch = Touch;
|
||||
R3.Input = Input;
|
||||
R3.Input.Touch = Touch;
|
||||
R3.Runtime = Runtime;
|
||||
|
||||
console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate);
|
||||
|
|
29
graph.php
29
graph.php
|
@ -256,6 +256,35 @@ class Graph
|
|||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all children of this node in a flat (1 dimensional) array
|
||||
* @param $node
|
||||
*/
|
||||
public function flatten($node)
|
||||
{
|
||||
|
||||
if (sizeof($node->children) === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($node->children as $child) {
|
||||
|
||||
array_push($result, $child);
|
||||
|
||||
$children = $this->flatten($child);
|
||||
|
||||
foreach ($children as $child2) {
|
||||
array_push($result, $child2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Node
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "r3",
|
||||
"version" : "2.0.176",
|
||||
"version" : "2.0.185",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
|
37
r3.php
37
r3.php
|
@ -1082,14 +1082,16 @@ function generateIndex($types)
|
|||
|
||||
foreach ($types as $type) {
|
||||
|
||||
$nodes = $graph->search('name', $type);
|
||||
$node = $graph->search('name', $type);
|
||||
|
||||
$template = file_get_contents('src/templates/index.template');
|
||||
|
||||
$imports = [];
|
||||
$exports = [];
|
||||
|
||||
$nodes = array_merge([$nodes], $nodes->children);
|
||||
$children = $graph->flatten($node);
|
||||
|
||||
$nodes = array_merge([$node], $children);
|
||||
|
||||
foreach ($nodes as $child) {
|
||||
|
||||
|
@ -1124,21 +1126,33 @@ function generateIndex($types)
|
|||
}
|
||||
}
|
||||
|
||||
function generateR3($nodes)
|
||||
function generateR3($nodes, $graph)
|
||||
{
|
||||
$imports = [];
|
||||
$defines = [];
|
||||
$convenientDefines = [];
|
||||
|
||||
foreach ($nodes as $node) {
|
||||
$file = str_replace('src/r3', '.', $node->file);
|
||||
array_push($imports, "const " . $node->name . ' = require(\'' . $file . "');");
|
||||
array_push($defines, $node->nameSpace . $node->nameSpaceClassName . ' = ' . $node->name);
|
||||
|
||||
if (sizeof($node->children) > 0 && substr_count($node->nameSpace, ".") > 1) {
|
||||
$convenientDefine = "R3." . $node->nameSpaceClassName . ' = ' . $node->name;
|
||||
array_push($convenientDefines, $convenientDefine);
|
||||
$file = str_replace('src/r3', '.', $node->file);
|
||||
|
||||
array_push($imports, "const " . $node->name . ' = require(\'' . $file . "');");
|
||||
|
||||
if ((sizeof($node->children) > 0)) {
|
||||
|
||||
$define = "R3." . $node->nameSpaceClassName . ' = ' . $node->name;
|
||||
array_push($defines, $define);
|
||||
|
||||
$children = $graph->flatten($node);
|
||||
|
||||
foreach ($children as $child) {
|
||||
$define = "R3." . $node->nameSpaceClassName . '.' . $child->nameSpaceClassName . ' = ' . $child->name;
|
||||
array_push($defines, $define);
|
||||
}
|
||||
|
||||
} else if ($node->parent->parent === null) {
|
||||
array_push($defines, $node->nameSpace . $node->nameSpaceClassName . ' = ' . $node->name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1163,7 +1177,6 @@ function generateR3($nodes)
|
|||
|
||||
updateSection($r3File, 'GENERATED_IMPORTS', implode("\n", $imports));
|
||||
updateSection($r3File, 'GENERATED_DEFINES', implode(";\n", $defines) . ";");
|
||||
updateSection($r3File, 'GENERATED_CONVENIENT_DEFINES', implode(";\n", $convenientDefines) . ";");
|
||||
|
||||
if (in_array('CUSTOM_CONVENIENT_DEFINES', array_keys($tokens))) {
|
||||
updateSection($r3File, 'CUSTOM_CONVENIENT_DEFINES', $tokens['CUSTOM_CONVENIENT_DEFINES']);
|
||||
|
@ -1648,7 +1661,7 @@ if ($argv[2] == 'build-dist') {
|
|||
|
||||
updateParentSystems($nodes);
|
||||
|
||||
generateR3($nodes);
|
||||
generateR3($nodes, $graph);
|
||||
generateR3Dist($nodes);
|
||||
|
||||
foreach ($files as $file) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
//GENERATED_IMPORTS_START
|
||||
const Component = require('./r3-component.js');
|
||||
const Image = require('./r3-image.js');
|
||||
const Input = require('./r3-input.js');
|
||||
const Touch = require('./r3-touch.js');
|
||||
//GENERATED_IMPORTS_END
|
||||
|
||||
//GENERATED_INDEX_BODY_START
|
||||
|
@ -9,6 +11,8 @@ const Image = require('./r3-image.js');
|
|||
module.exports = {
|
||||
//GENERATED_EXPORTS_START
|
||||
Component,
|
||||
Image
|
||||
Image,
|
||||
Input,
|
||||
Touch
|
||||
//GENERATED_EXPORTS_END
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
const Utils = require('./r3-utils');
|
||||
const Event = require('./r3-event.js');
|
||||
const Event = require('.././r3-event');
|
||||
const Utils = require('.././r3-utils');
|
||||
const Component = require('.././r3-component.js');
|
||||
|
||||
/**
|
||||
|
||||
GENERATED_INHERITED_START
|
||||
|
||||
Class R3.Event.Runtime
|
||||
Class R3.Event.Object.Component.Input
|
||||
[Inherited from Event]
|
||||
|
||||
Inherited Properties:
|
||||
|
@ -42,7 +43,53 @@ const Event = require('./r3-event.js');
|
|||
- Subscribe(eventId, callback)
|
||||
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
|
||||
|
||||
[Belonging to Runtime]
|
||||
[Inherited from R3Object]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- register (Default value true)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
<no inherited methods>
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Inherited from Component]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- runtime (Default value R3.Runtime.DEFAULT)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- createInstance()
|
||||
No comment
|
||||
|
||||
- dispose()
|
||||
No comment
|
||||
|
||||
- disposeInstance()
|
||||
No comment
|
||||
|
||||
- getRuntime()
|
||||
No comment
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Belonging to Input]
|
||||
|
||||
Properties:
|
||||
|
||||
|
@ -84,7 +131,7 @@ const Event = require('./r3-event.js');
|
|||
|
||||
**/
|
||||
|
||||
class Runtime extends Event {
|
||||
class Input extends Component {
|
||||
|
||||
//GENERATED_CONSTRUCTOR_EXTENDS_START
|
||||
constructor(options) {
|
||||
|
@ -111,6 +158,7 @@ class Runtime extends Event {
|
|||
this.emit(Event.OBJECT_INITIALIZED, this);
|
||||
|
||||
//CUSTOM_AFTER_INIT_START
|
||||
this.emit(Event.INPUT_COMPONENT_INITIALIZED);
|
||||
//CUSTOM_AFTER_INIT_END
|
||||
}
|
||||
//GENERATED_CONSTRUCTOR_EXTENDS_END
|
||||
|
@ -126,10 +174,6 @@ class Runtime extends Event {
|
|||
}
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
|
||||
Runtime.DEFAULT = 0x1;
|
||||
Runtime.GRAPHICS = 0x2;
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
module.exports = Runtime;
|
||||
module.exports = Input;
|
|
@ -0,0 +1,196 @@
|
|||
const Event = require('.././r3-event');
|
||||
const Utils = require('.././r3-utils');
|
||||
const Input = require('.././r3-input.js');
|
||||
|
||||
/**
|
||||
|
||||
GENERATED_INHERITED_START
|
||||
|
||||
Class R3.Event.Object.Component.Input.Touch
|
||||
[Inherited from Event]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
<no inherited properties>
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Async()' passing it the arguments
|
||||
|
||||
- emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Simply calls 'Emit()' passing it the arguments
|
||||
|
||||
- subscribe(eventId, callback)
|
||||
Simply calls 'Subscribe()' passing it the arguments
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
- Async(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
|
||||
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
|
||||
error as argument.
|
||||
|
||||
- Emit(eventId, data, clientCallback, clientErrorCallback)
|
||||
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
|
||||
the event result is obtained, passing it the result. If an exception occurs during execution, the
|
||||
clientErrorCallback is called with the error as argument.
|
||||
|
||||
- Subscribe(eventId, callback)
|
||||
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
|
||||
|
||||
[Inherited from R3Object]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- register (Default value true)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
<no inherited methods>
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Inherited from Component]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
- runtime (Default value R3.Runtime.DEFAULT)
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
- createInstance()
|
||||
No comment
|
||||
|
||||
- dispose()
|
||||
No comment
|
||||
|
||||
- disposeInstance()
|
||||
No comment
|
||||
|
||||
- getRuntime()
|
||||
No comment
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Inherited from Input]
|
||||
|
||||
Inherited Properties:
|
||||
|
||||
<no inherited properties>
|
||||
|
||||
Inherited Static Properties:
|
||||
|
||||
<no inherited static properties>
|
||||
|
||||
Inherited Methods:
|
||||
|
||||
<no inherited methods>
|
||||
|
||||
Inherited Static Methods:
|
||||
|
||||
<no inherited static methods>
|
||||
|
||||
[Belonging to Touch]
|
||||
|
||||
Properties:
|
||||
|
||||
<no properties>
|
||||
|
||||
Static Properties:
|
||||
|
||||
<no static properties>
|
||||
|
||||
Methods:
|
||||
|
||||
<no methods>
|
||||
|
||||
Static Methods:
|
||||
|
||||
<no static methods>
|
||||
|
||||
GENERATED_INHERITED_END
|
||||
|
||||
Of the form x=<value>
|
||||
CUSTOM_OPTIONS_START
|
||||
CUSTOM_OPTIONS_END
|
||||
|
||||
Of the form x=<instance.property>
|
||||
CUSTOM_INSTANCE_OPTIONS_MAPPING_START
|
||||
CUSTOM_INSTANCE_OPTIONS_MAPPING_END
|
||||
|
||||
CUSTOM_LINKED_OBJECTS_START
|
||||
CUSTOM_LINKED_OBJECTS_END
|
||||
|
||||
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START
|
||||
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END
|
||||
|
||||
CUSTOM_METHODS_START
|
||||
CUSTOM_METHODS_END
|
||||
|
||||
CUSTOM_STATIC_METHODS_START
|
||||
CUSTOM_STATIC_METHODS_END
|
||||
|
||||
**/
|
||||
|
||||
class Touch extends Input {
|
||||
|
||||
//GENERATED_CONSTRUCTOR_EXTENDS_START
|
||||
constructor(options) {
|
||||
|
||||
if (typeof options === 'undefined') {
|
||||
options = {};
|
||||
}
|
||||
|
||||
super(options);
|
||||
|
||||
this.emit(Event.OBJECT_CREATED, this);
|
||||
|
||||
//GENERATED_OPTIONS_INIT_START
|
||||
//GENERATED_OPTIONS_INIT_END
|
||||
|
||||
//CUSTOM_OPTIONS_INIT_START
|
||||
//CUSTOM_OPTIONS_INIT_END
|
||||
|
||||
Object.assign(this, options);
|
||||
|
||||
//CUSTOM_BEFORE_INIT_START
|
||||
//CUSTOM_BEFORE_INIT_END
|
||||
|
||||
this.emit(Event.OBJECT_INITIALIZED, this);
|
||||
|
||||
//CUSTOM_AFTER_INIT_START
|
||||
//CUSTOM_AFTER_INIT_END
|
||||
}
|
||||
//GENERATED_CONSTRUCTOR_EXTENDS_END
|
||||
|
||||
//GENERATED_METHODS_START
|
||||
//GENERATED_METHODS_END
|
||||
|
||||
//GENERATED_STATIC_METHODS_START
|
||||
//GENERATED_STATIC_METHODS_END
|
||||
|
||||
//CUSTOM_IMPLEMENTATION_START
|
||||
//CUSTOM_IMPLEMENTATION_END
|
||||
}
|
||||
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
module.exports = Touch;
|
|
@ -313,24 +313,25 @@ Event.DISPOSE_INSTANCE = 0x3;
|
|||
Event.DISPOSE_OBJECT = 0x4;
|
||||
Event.GET_RUNTIME = 0x5;
|
||||
Event.GET_WINDOW_SIZE = 0x6;
|
||||
Event.INSTANCE_CREATED = 0x7;
|
||||
Event.INSTANCE_DISPOSED = 0x8;
|
||||
Event.KEYBOARD_DOWN = 0x9;
|
||||
Event.KEYBOARD_UP = 0xa;
|
||||
Event.MOUSE_DOWN = 0xb;
|
||||
Event.MOUSE_MOVE = 0xc;
|
||||
Event.MOUSE_UP = 0xd;
|
||||
Event.MOUSE_WHEEL = 0xe;
|
||||
Event.OBJECT_CREATED = 0xf;
|
||||
Event.OBJECT_INITIALIZED = 0x10;
|
||||
Event.PAUSE = 0x11;
|
||||
Event.RESTART = 0x12;
|
||||
Event.START = 0x13;
|
||||
Event.TOUCH_CANCEL = 0x14;
|
||||
Event.TOUCH_END = 0x15;
|
||||
Event.TOUCH_MOVE = 0x16;
|
||||
Event.TOUCH_START = 0x17;
|
||||
Event.MAX_EVENTS = 0x18;
|
||||
Event.INPUT_COMPONENT_INITIALIZED = 0x7;
|
||||
Event.INSTANCE_CREATED = 0x8;
|
||||
Event.INSTANCE_DISPOSED = 0x9;
|
||||
Event.KEYBOARD_DOWN = 0xa;
|
||||
Event.KEYBOARD_UP = 0xb;
|
||||
Event.MOUSE_DOWN = 0xc;
|
||||
Event.MOUSE_MOVE = 0xd;
|
||||
Event.MOUSE_UP = 0xe;
|
||||
Event.MOUSE_WHEEL = 0xf;
|
||||
Event.OBJECT_CREATED = 0x10;
|
||||
Event.OBJECT_INITIALIZED = 0x11;
|
||||
Event.PAUSE = 0x12;
|
||||
Event.RESTART = 0x13;
|
||||
Event.START = 0x14;
|
||||
Event.TOUCH_CANCEL = 0x15;
|
||||
Event.TOUCH_END = 0x16;
|
||||
Event.TOUCH_MOVE = 0x17;
|
||||
Event.TOUCH_START = 0x18;
|
||||
Event.MAX_EVENTS = 0x19;
|
||||
|
||||
Event.GetEventName = function(eventId) {
|
||||
|
||||
|
@ -341,23 +342,24 @@ Event.GetEventName = function(eventId) {
|
|||
case 0x4 : return 'dispose_object';
|
||||
case 0x5 : return 'get_runtime';
|
||||
case 0x6 : return 'get_window_size';
|
||||
case 0x7 : return 'instance_created';
|
||||
case 0x8 : return 'instance_disposed';
|
||||
case 0x9 : return 'keyboard_down';
|
||||
case 0xa : return 'keyboard_up';
|
||||
case 0xb : return 'mouse_down';
|
||||
case 0xc : return 'mouse_move';
|
||||
case 0xd : return 'mouse_up';
|
||||
case 0xe : return 'mouse_wheel';
|
||||
case 0xf : return 'object_created';
|
||||
case 0x10 : return 'object_initialized';
|
||||
case 0x11 : return 'pause';
|
||||
case 0x12 : return 'restart';
|
||||
case 0x13 : return 'start';
|
||||
case 0x14 : return 'touch_cancel';
|
||||
case 0x15 : return 'touch_end';
|
||||
case 0x16 : return 'touch_move';
|
||||
case 0x17 : return 'touch_start';
|
||||
case 0x7 : return 'input_component_initialized';
|
||||
case 0x8 : return 'instance_created';
|
||||
case 0x9 : return 'instance_disposed';
|
||||
case 0xa : return 'keyboard_down';
|
||||
case 0xb : return 'keyboard_up';
|
||||
case 0xc : return 'mouse_down';
|
||||
case 0xd : return 'mouse_move';
|
||||
case 0xe : return 'mouse_up';
|
||||
case 0xf : return 'mouse_wheel';
|
||||
case 0x10 : return 'object_created';
|
||||
case 0x11 : return 'object_initialized';
|
||||
case 0x12 : return 'pause';
|
||||
case 0x13 : return 'restart';
|
||||
case 0x14 : return 'start';
|
||||
case 0x15 : return 'touch_cancel';
|
||||
case 0x16 : return 'touch_end';
|
||||
case 0x17 : return 'touch_move';
|
||||
case 0x18 : return 'touch_start';
|
||||
default :
|
||||
throw new Error('Event type not defined : ' + eventId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class R3 {
|
||||
static version = '2.0.176';
|
||||
static compileDate = '2021 Sep 06 - 13:04:25 pm';
|
||||
static version = '2.0.185';
|
||||
static compileDate = '2021 Sep 07 - 07:56:14 am';
|
||||
}
|
||||
|
||||
//GENERATED_IMPORTS_START
|
||||
|
@ -12,34 +12,45 @@ const SystemLinking = require('./r3-system/r3-system-linking.js');
|
|||
const SystemSocket = require('./r3-system/r3-system-socket.js');
|
||||
const SystemTest = require('./r3-system/r3-system-test.js');
|
||||
const R3Object = require('./r3-r3-object.js');
|
||||
const Runtime = require('./r3-runtime.js');
|
||||
const Component = require('./r3-component/r3-component.js');
|
||||
const Project = require('./r3-project.js');
|
||||
const Image = require('./r3-component/r3-image.js');
|
||||
const Input = require('./r3-component/r3-input.js');
|
||||
const Touch = require('./r3-component/r3-touch.js');
|
||||
//GENERATED_IMPORTS_END
|
||||
|
||||
//GENERATED_DEFINES_START
|
||||
R3.System = System;
|
||||
R3.Event = Event;
|
||||
R3.Utils = Utils;
|
||||
R3.System.Input = SystemInput;
|
||||
R3.System.Linking = SystemLinking;
|
||||
R3.System.Socket = SystemSocket;
|
||||
R3.System.Test = SystemTest;
|
||||
R3.Event = Event;
|
||||
R3.Event.Object = R3Object;
|
||||
R3.Event.Runtime = Runtime;
|
||||
R3.Event.Object.Component = Component;
|
||||
R3.Event.Object.Project = Project;
|
||||
R3.Event.Object.Component.Image = Image;
|
||||
R3.Event.Component = Component;
|
||||
R3.Event.Image = Image;
|
||||
R3.Event.Input = Input;
|
||||
R3.Event.Touch = Touch;
|
||||
R3.Event.Project = Project;
|
||||
R3.Utils = Utils;
|
||||
R3.Object = R3Object;
|
||||
R3.Object.Component = Component;
|
||||
R3.Object.Image = Image;
|
||||
R3.Object.Input = Input;
|
||||
R3.Object.Touch = Touch;
|
||||
R3.Object.Project = Project;
|
||||
R3.Component = Component;
|
||||
R3.Component.Image = Image;
|
||||
R3.Component.Input = Input;
|
||||
R3.Component.Touch = Touch;
|
||||
R3.Input = Input;
|
||||
R3.Input.Touch = Touch;
|
||||
//GENERATED_DEFINES_END
|
||||
|
||||
//GENERATED_CONVENIENT_DEFINES_START
|
||||
R3.Object = R3Object;
|
||||
R3.Component = Component;
|
||||
//GENERATED_CONVENIENT_DEFINES_END
|
||||
|
||||
//CUSTOM_CONVENIENT_DEFINES_START
|
||||
R3.Runtime = Runtime;
|
||||
//CUSTOM_CONVENIENT_DEFINES_END
|
||||
|
||||
module.exports = R3;
|
||||
|
|
Loading…
Reference in New Issue