Jump to content

Search the Community

Showing results for tags 'tolocal'.

  • 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. I'm reading some tutorials about pixi.js and I can't understand the result I got from toLocal. I expect the result to be 100,100 however I got 200,200. Console output: bunny1: 100 100 bunny2: 200 200 200 200 Code: // create our little bunny friend..S var bunny = new PIXI.Sprite(texture); bunny.interactive = true; bunny.buttonMode = true; bunny.anchor.set(0.5); bunny.scale.set(1); bunny.x = 100; bunny.y = 100; // create our little bunny friend..S var bunny2 = new PIXI.Sprite(texture); bunny2.interactive = true; bunny2.buttonMode = true; bunny2.anchor.set(0.5); bunny2.scale.set(1); bunny2.x = 200; bunny2.y = 200; // add it to the stage app.stage.addChild(bunny); app.stage.addChild(bunny2); console.log("bunny1:",bunny.x,bunny.y) console.log("bunny2:",bunny2.x,bunny2.y) console.log(bunny.toLocal(bunny.position, bunny2).x,bunny.toLocal(bunny.position, bunny2).y)
×
×
  • Create New...