# playcanvas-attributes

> Extends PlayCanvas attribute definitions to support a 'set' method, this also enables intellisense for PlayCanvas attributes in WebStorm and other IDEs.

Latest version **1.0.2** (published 2017-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install playcanvas-attributes
pnpm add playcanvas-attributes
yarn add playcanvas-attributes
bun add playcanvas-attributes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-09-13 |
| First published | 2017-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mike Talbot |
| Maintainers | whydoidoit |
| Keywords | PlayCanvas |

## Links

- npm: https://www.npmjs.com/package/playcanvas-attributes
- Repository: https://github.com/whydoidoit/playcanvas-attributes
- Homepage: https://github.com/whydoidoit/playcanvas-attributes#readme
- Issues: https://github.com/whydoidoit/playcanvas-attributes/issues
- npm.io page: https://npm.io/package/playcanvas-attributes

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-09-13
- 1.0.1 — 2017-09-10
- 1.0.0 — 2017-09-10

## README

### Introduction

Creates a series of properties on pc.attr in PlayCanvas which return attribute definitions

### Installation

```language-shell
npm intall --save playcanvas-attributes
```

### Usage

```language-javascript
import 'playcanvas-attributes'

...

var MyClass = pc.createScript('myclass');
MyClass.attributes.add('vector', pc.attr.vec3.default(0,0,1));
MyClass.attributes.add('number', pc.attr.number);
MyClass.attributes.add('texture', pc.attr.texture);
MyClass.attributes.add('enumeratedNumber', pc.attr.number
    .enum({"Test": 1, "Again": 2})
    .default(1)
);
 

```

Includes all current attributes with "sensible" names. Vector defaults can be 3 numbers, an array or
an existing pc.Vec3 e.g. `pc.Vec3.FORWARD`. Colors can be a pc.Color or an array.

Available attributes are:

`string`, `number`, `boolean`, `entity`, `animation`, `audio`, `vec3`, `curve`, `curveSet`, `model`,
`material`, `json`, `text`, `html`, `css`, `shader`, `font`, `binary`, `texture`, `scene`, `rgb`, `rgba`

### Requirements

Requires PlayCanvas Engine to be running on the page.  Uses ES6/Babel/PlayCanvas template.

---
_Source: https://npm.io/package/playcanvas-attributes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
