Jump to content

Search the Community

Showing results for tags 'scale center tilingSprite'.

  • 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, I've experimented, googled and read the API and I still can't figure this out even though it is extremely simple I want my image to remain in the center of my canvas as it becomes larger. function init() { stage = new PIXI.Stage(0x66FF99); renderer = new PIXI.autoDetectRenderer(512, 384, document.getElementById("game-canvas")); var midTexture = PIXI.Texture.fromImage("resources/mid2.png"); mid = new PIXI.TilingSprite(midTexture, 256, 384); stage.addChild(mid); requestAnimFrame(update); } function update() { mid.scale.x *= 1.001; mid.tilePosition.y += 1.21; // I want it to remain centered as it gets larger, this attempt does not work: mid.position.x = (512 - mid.width) / 2 ; renderer.render(stage); requestAnimFrame(update); }Any help would be appreciated, I have already spent way too long trying to figure this out
×
×
  • Create New...