Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@robotlegsjs/createjs
Advanced tools
Integrate RobotlegsJS framework with CreateJS.
You can get the latest release and the type definitions using NPM:
npm install @robotlegsjs/createjs --save
Or using Yarn:
yarn add @robotlegsjs/createjs
The EaselJS dependency is added as peerDependencies, allowing the final user to choose the desired version of the easeljs library on each project.
The @robotlegsjs/createjs
package is compatible with versions between the >=1.0.2 <2
version range of easeljs
library.
As example, when you would like to use the version 1.0.2
of easeljs
library, you can run:
npm install easeljs@1.0.2 reflect-metadata --save
or
yarn add easeljs@1.0.2 reflect-metadata
Then follow the installation instructions of RobotlegsJS library to complete the setup of your project.
Dependencies
Peer Dependencies
import { Context, MVCSBundle } from "@robotlegsjs/core";
import { ContextView, CreateJSBundle } from "@robotlegsjs/createjs";
import { MyConfig } from "./config/MyConfig";
import { RobotlegsView } from "./view/RobotlegsView";
export class Game {
private _canvas: HTMLCanvasElement;
private _stage: createjs.Stage;
private _context: Context;
constructor () {
this.init();
}
private init(): void {
this._canvas = <HTMLCanvasElement>(document.getElementById("canvas"));
this._stage = new createjs.Stage(this._canvas);
this._context = new Context();
this._context.install(MVCSBundle, CreateJSBundle).
configure(new ContextView(this._stage)).
configure(MyConfig).
initialize();
// enable touch interactions if supported on the current device:
createjs.Touch.enable(this._stage);
// enabled mouse over / out events
this._stage.enableMouseOver(10);
this._stage.mouseMoveOutside = true; // keep tracking the mouse even when it leaves the canvas
let robotlegs: RobotlegsView = new RobotlegsView();
robotlegs.x = this._canvas.width / 2;
robotlegs.y = this._canvas.height / 2;
this._stage.addChild(robotlegs);
window.addEventListener("resize", this.handleResize.bind(this));
createjs.Ticker.addEventListener("tick", this.tick.bind(this));
}
private handleResize(): void {
this._stage.update();
}
private tick(event: Object): void {
this._stage.update(event);
}
}
Run the following commands to run the example:
npm install
npm start
or:
yarn install
yarn start
Available as part of the Tidelift Subscription
The maintainers of @robotlegsjs/createjs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
FAQs
CreateJS View Integration with RobotlegsJS
The npm package @robotlegsjs/createjs receives a total of 10 weekly downloads. As such, @robotlegsjs/createjs popularity was classified as not popular.
We found that @robotlegsjs/createjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.