Tutorial by Examples

Common Lisp has 12 type specific operators to compare two characters, 6 of them case sensitives and the others case insensitives. Their names have a simple pattern to make easy to remember their meaning: Case SensitiveCase InsensitiveCHAR=CHAR-EQUALCHAR/=CHAR-NOT-EQUALCHAR<CHAR-LESSPCHAR<=CHA...
In Common Lisp there are many different predicates for comparing values. They can be classified in the following categories: Generic equality operators: EQ, EQL, EQUAL, EQUALP. They can be used for values of any type and return always a boolean value T or NIL. Type specific equality operators: =...
Foreword This is a detailed example about how to encrypt and decrypt data with Go. The uses code is shorten, e.g. the error handling is not mentioned. The full working project with error handling and user interface could be found on Github here. Encryption Introduction and data This example de...
The core idea is to use GameObjects to represent singletons, which has multiple advantages: Keeps complexity to a minimum but supports concepts like dependency injection Singletons have a normal Unity lifecycle as part of the Entity-Component system Singletons can be lazy loaded and cached loca...
C++20 is the upcoming standard of C++, currently in development, based upon the C++17 standard. It's progress can be tracked on the official ISO cpp website. The following features are simply what has been accepted for the next release of the C++ standard, targeted for 2020. Language Extensions N...
We can use the componentchanged event to listen for changes to the entity: entity.addEventListener('componentchanged', function (evt) { if (evt.detail.name === 'position') { console.log('Entity has moved from', evt.detail.oldData, 'to', evt.detail.newData, '!'); } });
We can use the child-attached and child-detached events to listen for when the scene attaches or detaches an entity: entity.addEventListener('child-attached', function (evt) { if (evt.detail.el.tagName.toLowerCase() === 'a-box') { console.log('a box element has been attached'); }; }); ...
Updating Multi-Property Component Data To update component data for a multi-property component, we can pass the name of a registered component as the componentName, and pass an object of properties as the value. A string is also acceptable (e.g., type: spot; distance: 30), but objects will save A-F...
We can simply retrieve an entity using DOM APIs. <a-entity id="mario"></a-entity> var el = document.querySelector('#mario');
For example, if we wanted to grab an entity’s three.js camera object or material object, we could reach into its components var camera = document.querySelector('a-entity[camera]').components.camera.camera; var material = document.querySelector('a-entity[material]').components.material.material; ...
A system is registered similarly to a A-Frame component. If the system name matches a component name, then the component will have a reference to the system as this.system: AFRAME.registerSystem('my-component', { schema: {}, // System schema. Parses into `this.data`. init: function () { ...
An instantiated system can be accessed through the scene: document.querySelector('a-scene').systems[systemName]; Registered system prototypes can be accessed through AFRAME.systems.
Systems can help separate logic and behavior from data if desired. We let systems handle the heavy lifting, and components only worry about managing its data through its lifecycle methods: AFRAME.registerSystem('my-component', { createComplexObject: function (data) { // Do calculations ...
There is no strict API for defining how systems manage components. A common pattern is to have components subscribe themselves to the system. The system then has references to all of its components: AFRAME.registerSystem('my-component', { init: function () { this.entities = []; }, ...
AFRAME.registerComponent (name, definition) Register an A-Frame component. We must register components before we use them anywhere in . Meaning from an HTML file, components should come in order before . {string} name - Component name. The component’s public API as represented through an HTML at...
A component holds a bucket of data in the form of one or more component properties. Components use this data to modify entities. Consider an engine component, we might define properties such as horsepower or cylinders. HTML attributes represent component names and the value of those attributes repr...
The schema is an object that defines and describes the property or properties of the component. The schema’s keys are the names of the property, and the schema’s values define the types and values of the property (in case of a multi-property component): Defining schema in your component AFRAME.reg...
Property types primarily define how the schema parses incoming data from the DOM for each property. The parsed data will then be available via the data property on the component's prototype. Below are A-Frame's built-in property types: Property TypeDescriptionDefault ValuearrayParses comma-separ...
A component’s members and methods can be accessed through the entity from the .components object. Look up the component from the entity’s map of components, and we’ll have access to the component’s internals. Consider this example component: AFRAME.registerComponent('foo', { init: function () { ...
Components can be attached to the scene as well as entities. A-Frame ships with a few components to configure the scene: ComponentDetailsembeddedRemove fullscreen styles from the canvas.fogAdd fog.keyboard-shortcutsToggle keyboard shortcuts.inspectorInject the A-Frame Inspector.statsToggle performa...

Page 1262 of 1336