Jump to content

How can I create and use non-bitmap Sprites?


hayesmaker
 Share

Recommended Posts

I'm trying to give some Graphics primitives collision properties, but can't find a way to do it.
 
Can I add Vector graphics to a Sprite like I could in Flash?
 
Or is it not even necessary?
 
The way I'm trying is to add some graphics to a group and set it as a collidable but that doesn't seem to work:

 

 

      var graphics = game.add.graphics(0,0);
      acesGroup = game.add.group();
      graphics.beginFill(0xff0000, 1);
      graphics.lineStyle(2,0xffd900, 1);
      graphics.drawRect(100, 100, 50, 70);
      graphics.endFill();
      acesGroup.add(graphics);
 
      game.physics.collide(acesGroup, cardGroup, collisionHandler, null, this);
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...