-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fullscreen system and update pointer system (#46)
- Loading branch information
1 parent
9147eb2
commit 90584d2
Showing
16 changed files
with
1,302 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,247 @@ | ||
|
||
# Class: FullscreenSystem | ||
|
||
FullscreenSystem handles JS fullscreen change events, and provides a method for requesting | ||
entering/existing fullscreen/pointer lock. | ||
|
||
## Hierarchy | ||
|
||
↳ [System](system.md) | ||
|
||
↳ **FullscreenSystem** | ||
|
||
↳ [TestFullscreenSystem](testfullscreensystem.md) | ||
|
||
## Implements | ||
|
||
* [ISubscriber](../interfaces/isubscriber.md) | ||
|
||
## Index | ||
|
||
### Constructors | ||
|
||
* [constructor](fullscreensystem.md#constructor) | ||
|
||
### Properties | ||
|
||
* [canvas](fullscreensystem.md#private-canvas) | ||
* [document](fullscreensystem.md#private-document) | ||
* [entities](fullscreensystem.md#protected-entities) | ||
* [messageBus](fullscreensystem.md#protected-messagebus) | ||
* [scene](fullscreensystem.md#protected-optional-scene) | ||
* [subscriberID](fullscreensystem.md#subscriberid) | ||
* [MESSAGE_DEREGISTER](fullscreensystem.md#static-message_deregister) | ||
* [MESSAGE_ENTER_FULLSCREEN](fullscreensystem.md#static-message_enter_fullscreen) | ||
* [MESSAGE_EXIT_FULLSCREEN](fullscreensystem.md#static-message_exit_fullscreen) | ||
* [MESSAGE_REGISTER](fullscreensystem.md#static-message_register) | ||
* [MESSAGE_REQUEST_ENTER_FULLSCREEN](fullscreensystem.md#static-message_request_enter_fullscreen) | ||
* [MESSAGE_REQUEST_EXIT_FULLSCREEN](fullscreensystem.md#static-message_request_exit_fullscreen) | ||
* [MESSAGE_UPDATE](fullscreensystem.md#static-message_update) | ||
|
||
### Methods | ||
|
||
* [Destroy](fullscreensystem.md#destroy) | ||
* [OnDestroy](fullscreensystem.md#protected-ondestroy) | ||
* [OnMessage](fullscreensystem.md#onmessage) | ||
* [Update](fullscreensystem.md#protected-update) | ||
* [onFullscreenChange](fullscreensystem.md#protected-onfullscreenchange) | ||
|
||
## Constructors | ||
|
||
### constructor | ||
|
||
\+ **new FullscreenSystem**(`messageBus`: [IMessageBus](../interfaces/imessagebus.md), `canvas`: HTMLCanvasElement, `document`: HTMLDocument, `__namedParameters`: object): *[FullscreenSystem](fullscreensystem.md)* | ||
|
||
*Overrides [System](system.md).[constructor](system.md#constructor)* | ||
|
||
**Parameters:** | ||
|
||
▪ **messageBus**: *[IMessageBus](../interfaces/imessagebus.md)* | ||
|
||
▪ **canvas**: *HTMLCanvasElement* | ||
|
||
▪ **document**: *HTMLDocument* | ||
|
||
▪`Default value` **__namedParameters**: *object*= { scene: undefined, entities: new Map(), subscriberID: undefined } | ||
|
||
Name | Type | | ||
------ | ------ | | ||
`entities` | Map‹number, [SystemEntity](systementity.md)‹›› | | ||
`scene` | undefined | [IScene](../interfaces/iscene.md) | | ||
`subscriberID` | undefined | number | | ||
|
||
**Returns:** *[FullscreenSystem](fullscreensystem.md)* | ||
|
||
## Properties | ||
|
||
### `Private` canvas | ||
|
||
• **canvas**: *HTMLCanvasElement* | ||
|
||
___ | ||
|
||
### `Private` document | ||
|
||
• **document**: *HTMLDocument* | ||
|
||
___ | ||
|
||
### `Protected` entities | ||
|
||
• **entities**: *Map‹number, [SystemEntity](systementity.md)›* | ||
|
||
*Inherited from [System](system.md).[entities](system.md#protected-entities)* | ||
|
||
___ | ||
|
||
### `Protected` messageBus | ||
|
||
• **messageBus**: *[IMessageBus](../interfaces/imessagebus.md)* | ||
|
||
*Inherited from [System](system.md).[messageBus](system.md#protected-messagebus)* | ||
|
||
___ | ||
|
||
### `Protected` `Optional` scene | ||
|
||
• **scene**? : *[IScene](../interfaces/iscene.md)* | ||
|
||
*Inherited from [System](system.md).[scene](system.md#protected-optional-scene)* | ||
|
||
___ | ||
|
||
### subscriberID | ||
|
||
• **subscriberID**: *number* | ||
|
||
*Implementation of [ISubscriber](../interfaces/isubscriber.md).[subscriberID](../interfaces/isubscriber.md#subscriberid)* | ||
|
||
*Inherited from [Subscriber](subscriber.md).[subscriberID](subscriber.md#subscriberid)* | ||
|
||
___ | ||
|
||
### `Static` MESSAGE_DEREGISTER | ||
|
||
▪ **MESSAGE_DEREGISTER**: *"system_deregister"* = "system_deregister" | ||
|
||
*Inherited from [System](system.md).[MESSAGE_DEREGISTER](system.md#static-message_deregister)* | ||
|
||
___ | ||
|
||
### `Static` MESSAGE_ENTER_FULLSCREEN | ||
|
||
▪ **MESSAGE_ENTER_FULLSCREEN**: *"message_enter_fullscreen"* = "message_enter_fullscreen" | ||
|
||
___ | ||
|
||
### `Static` MESSAGE_EXIT_FULLSCREEN | ||
|
||
▪ **MESSAGE_EXIT_FULLSCREEN**: *"message_exit_fullscreen"* = "message_exit_fullscreen" | ||
|
||
___ | ||
|
||
### `Static` MESSAGE_REGISTER | ||
|
||
▪ **MESSAGE_REGISTER**: *"system_register"* = "system_register" | ||
|
||
*Inherited from [System](system.md).[MESSAGE_REGISTER](system.md#static-message_register)* | ||
|
||
___ | ||
|
||
### `Static` MESSAGE_REQUEST_ENTER_FULLSCREEN | ||
|
||
▪ **MESSAGE_REQUEST_ENTER_FULLSCREEN**: *"message_request_enter_fullscreen"* = "message_request_enter_fullscreen" | ||
|
||
___ | ||
|
||
### `Static` MESSAGE_REQUEST_EXIT_FULLSCREEN | ||
|
||
▪ **MESSAGE_REQUEST_EXIT_FULLSCREEN**: *"message_request_exit_fullscreen"* = "message_request_exit_fullscreen" | ||
|
||
___ | ||
|
||
### `Static` MESSAGE_UPDATE | ||
|
||
▪ **MESSAGE_UPDATE**: *"system_update"* = "system_update" | ||
|
||
*Inherited from [System](system.md).[MESSAGE_UPDATE](system.md#static-message_update)* | ||
|
||
## Methods | ||
|
||
### Destroy | ||
|
||
▸ **Destroy**(): *void* | ||
|
||
*Inherited from [System](system.md).[Destroy](system.md#destroy)* | ||
|
||
Destroy destroys the System and unsubscribes it from all messages. | ||
The System should be garbage collected after this, unless a direct | ||
reference to it exists somewhere. Therefore direct references to | ||
systems are discouraged; communication should all be through the | ||
message bus. | ||
|
||
**Returns:** *void* | ||
|
||
___ | ||
|
||
### `Protected` OnDestroy | ||
|
||
▸ **OnDestroy**(): *void* | ||
|
||
*Inherited from [System](system.md).[OnDestroy](system.md#protected-ondestroy)* | ||
|
||
Custom Destroy logic should go here to facilitate garbage collection, for example | ||
removing listeners. | ||
|
||
**Returns:** *void* | ||
|
||
___ | ||
|
||
### OnMessage | ||
|
||
▸ **OnMessage**(`message`: [IMessage](../interfaces/imessage.md)): *void* | ||
|
||
*Overrides [System](system.md).[OnMessage](system.md#onmessage)* | ||
|
||
**Parameters:** | ||
|
||
Name | Type | | ||
------ | ------ | | ||
`message` | [IMessage](../interfaces/imessage.md) | | ||
|
||
**Returns:** *void* | ||
|
||
___ | ||
|
||
### `Protected` Update | ||
|
||
▸ **Update**(`dt`: number): *void* | ||
|
||
*Inherited from [System](system.md).[Update](system.md#protected-update)* | ||
|
||
General update method, default empty. Override with custom logic. | ||
|
||
**Parameters:** | ||
|
||
Name | Type | Description | | ||
------ | ------ | ------ | | ||
`dt` | number | DeltaTime | | ||
|
||
**Returns:** *void* | ||
|
||
___ | ||
|
||
### `Protected` onFullscreenChange | ||
|
||
▸ **onFullscreenChange**(`event`: Event): *void* | ||
|
||
When a fullsceenchange event occurs this method is called, handles forwarding the fullscreen events | ||
into the JamJar ECS messaging system. | ||
|
||
**Parameters:** | ||
|
||
Name | Type | Description | | ||
------ | ------ | ------ | | ||
`event` | Event | The fullscreenchange event | | ||
|
||
**Returns:** *void* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.