hayesmaker Posted November 15, 2013 Share Posted November 15, 2013 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 More sharing options...
Chris Posted November 16, 2013 Share Posted November 16, 2013 It should be possible to load svg files as normal images and use them as assets for your sprites.The only problem with that approach is that you won't get access to the elements in the svg files to animate the shapes or change colors. Link to comment Share on other sites More sharing options...
hayesmaker Posted November 16, 2013 Author Share Posted November 16, 2013 My problem is not that I cannot create a bitmap from a vector, my problem is I can't use Phaser's built in Graphics drawing tools to create a Sprite or something which I can call physics functions on. Link to comment Share on other sites More sharing options...
Recommended Posts