GithubHelp home page GithubHelp logo

milesmcbain / aframe-sprite-component Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tizzle/aframe-sprite-component

0.0 3.0 0.0 434 KB

A Sprite component for A-Frame VR

License: MIT License

JavaScript 100.00%

aframe-sprite-component's Introduction

aframe-sprite-component

An implementation of the Sprite primitive from ThreeJS – a bitmap image always facing the camera – for A-Frame.

Have a look at the examples

API

Property Description Default Value
src String – the name of the image to use in the SpriteMaterial ''
resize String – resize vector to scale the Sprite '1 1 1'

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>A-Frame using a Sprite</title>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
  <script src="https://cdn.rawgit.com/tizzle/aframe-sprite-component/master/dist/aframe-sprite-component.min.js"></script>
</head>

<body>

    <a-scene>
        <a-assets>
            <img id="hotspotimage" src="hotspot.png">
        </a-assets>

        <a-entity camera position="0 0 5"></a-entity>

        <a-sprite position="0 0 0" resize="1 1 1" src="hotspot.png"></a-sprite>

        <a-sky color="#AADDF0"></a-sky>

    </a-scene>

</body>

npm

Install via npm:

npm install aframe-sprite-component

Then register and use.

require('aframe');
require('aframe-sprite-component');

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.