These are chat archives for pixijs/pixi.js

Jun 2016
Century Guo
Jun 02 2016 12:11 UTC
how can i use web font in pixi? I linked a web font in my html and use it as var text = new PIXI.Text('text', {font: "32px fontname", fill:'color', align: 'center'});it's not effective,is it because the font has not loaded ? so hoe can i know the font is loaded?
Ivan Popelyshev
Jun 02 2016 12:12 UTC
if you can use it on the page
then you can use it in text
I dont know about loading though
may be if font is not yet loaded it will be a problem but I really dont know if Fonts are async loaded or not
Jun 02 2016 15:31 UTC

Hi, I'm trying to use onMouseDown, who should destroy the object it clicks (a roundedRect of the Graphics class), but i get the error 'TypeError: a is null' (in pixi.min.js)

the code concerned is the following:

var tweetBox = new PIXI.Graphics()
tweetBox.lineStyle(4, 0x99CCFF, 1)
tweetBox.drawRoundedRect(0, 0, 250, 400, 10)
tweetBox.x = 48
tweetBox.y = 190
tweetBox.interactive = true
var clicked = false
  .on('mousedown', onMouseDown)
  .on('mouseup', onMouseUp)

// Add theetBox to the stage

function onMouseDown () {
  clicked = true

function onMouseUp () {
  if (clicked) this.destroy()
  clicked = false
  console.log('something happened')
Maybe I'm not using the right function, is the function onMouseDown for a click event or I am wrong?
Ivan Popelyshev
Jun 02 2016 17:00 UTC
you didnt remove it from parent
i dont think destroy() can do that
Jun 02 2016 18:23 UTC
hi, k I'll try