Jump to content

Search the Community

Showing results for tags 'local point'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi all, long time lurker, love the framework! The fact that I've done two weeks of coding without having to ask a question really shows the quality of Phaser, the docs, and the wealth of information on the forums! Unfortunately, I couldn't find an answer to this. I'm trying to get a local point on a P2JS body converted to world co-ordinates. To put it into context: I want another sprite to move to a specific point on a physics body. Funny enough, there are parameters in the physics.p2.createSpring() that allow you to specify local points on the bodies to attach the spring to. Similar parameters are found in the P2JS constraint cosntructors. However, looking at the source code taught me nothing because it's just a reference to the P2JS spring creator. I looked in the P2JS docs to find a LinearSpring.getWorldAnchorA() function, but calling it as spring.data.getWorldAnchorA() results in the following error: Uncaught TypeError: Cannot set property '0' of undefined Phaser.js:79022 I suppose I could put the body in a group along with an invisible sprite to mark the local point and get sprite.world, but that feels so hacky. I'd create an empty group to mark the point, but groups don't have a world attribute. I could found no function in the Phaser docs to convert a local point to a world point, which seems such a simple and common thing to do. Am I missing something?
×
×
  • Create New...