0.4.3 • Published 5 years ago
@amoy/query v0.4.3
Usage
import { Application, Text, Container, Sprite } from 'pixi.js'
import query from '@amoy/query'
const game = new Application({
width: window.innerWidth,
height: window.innerHeight,
})
query(game.stage)
const t1 = new Text('Hello World.', {
fill: 0xffffff,
})
t1.class = 'text'
t1.x = 200
t1.y = 200
const t2 = new Text('Hello World.', {
fill: 0xffffff,
})
t2.name = 'text'
t2.x = 300
t2.y = 300
const s1 = Sprite.from(document.querySelector('img'))
game.stage.addChild(t1, t2, s1)
$('[class=text]') // t1
// or
$('.text') // t1
$('[name=text]') // t2
Contribution
How to extend a method:
import query from '@amoy/query'
query.extend({
methodName() {
for (let i = 0; i < this.length; i++) {
// this[i]
// do something on `this[i]`
}
}
})
$('sprite').methodName()
0.4.3
5 years ago
0.4.2
5 years ago
0.4.1
5 years ago
0.4.0
5 years ago
0.3.9
5 years ago
0.3.8
5 years ago
0.3.7
5 years ago
0.3.6
5 years ago
0.3.5
5 years ago
0.3.4
5 years ago
0.3.3
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago