1. @vf.js/vf
为HTML5建立的引擎:快速、灵活,基于WebGL的2D渲染。
@vf.js/vf
Package: @vf.js/vf
Created by: vf-js
Last modified: Thu, 07 Apr 2022 10:36:26 GMT
Version: 6.0.2-v65
License: MIT
Downloads: 255
Repository: https://github.com/vf-js/vf

Install

npm install @vf.js/vf
yarn add @vf.js/vf

不能直接使用!!!!

不能直接使用!!!!

不能直接使用!!!!

不能直接使用!!!!

不能直接使用!!!!

不能直接使用!!!!

Install

npm install @vf.js/vf
 <script src="./node_modules/@vf.js/vf/dist/vf.js"></script> 

Basic Usage Example

 // The application will create a renderer using WebGL, if possible,
// with a fallback to a canvas render. It will also setup the ticker
// and the root stage VF.Container.
const app = new VF.Application();

// The application will create a canvas element for you that you
// can then insert into the DOM.
document.body.appendChild(app.view);

// load the texture we need
app.loader.add('bunny', 'bunny.png').load((loader, resources) => {

    // This creates a texture from a 'bunny.png' image.
    const bunny = new VF.Sprite(resources.bunny.texture);

    // Setup the position of the bunny
    bunny.x = app.renderer.width / 2;
    bunny.y = app.renderer.height / 2;

    // Rotate around the center
    bunny.anchor.x = 0.5;
    bunny.anchor.y = 0.5;

    // Add the bunny to the scene we are building.
    app.stage.addChild(bunny);

    // Listen for frame updates
    app.ticker.add(() => {
         // each frame we spin the bunny around a bit
        bunny.rotation += 0.01;
    });
});

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code