Git Product home page Git Product logo

flare's Introduction

Caution

FLARE is no longer updated and its repository has been archived.

FLARE

FLARE (Fast, Lightweight, Adaptable and Reactive Engine) is a 2D render engine.
It uses a custom canvas and does not make use of the native HTML <canvas> element.


Getting Started

Each FLARE implementation needs at least three components (although it will most likely be more):

<Scene>

Think of the <Scene> component kind of like the viewport of FLARE. Inside it is where it's all happening. The scene component is used to position FLARE on your website.

<Canvas>

The <Canvas> component is the components that actually renders your content. It is always the size of the Scene component.

<Rectangle>

The <Rectangle> component is a canvas element meaning it can be rendered on the canvas by passing it as a child to it. As the name implies it renders as a rectangle of the specified size.

<Circle>

The <Circle> component, too, is a canvas element. As the name suggests it renders as a circle.

This guide does not cover props. Use the TypeScript interfaces as reference.

Usage

import { Scene } from '@ewt-studios/flare'
import { Canvas } from '@ewt-studios/flare';
import { Rectangle } from '@ewt-studios/flare';

const App = () => {
  return (
    <Scene className="class-1 class-2">
      <Canvas>
        <Rectangle
          x={10}
          y={10}
          z={0} // Controls the z-index
          width={100}
          height={80}
          style="outline"
          color="green"
          borderWidth={2}
          key={0}
        >
          <div>Hello World from a rectangle!</div>
        </Rectangle>
        <Circle
          x={30}    
          y={30}
          z={0}
          diameter={100}
          key={1}
        >
          <div>Hello World from a circle!</div>
        </Circle>
      </Canvas>
    </Scene>
  )
}

flare's People

Contributors

examplewastaken avatar

flare's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.