Jump to content

Search the Community

Showing results for tags 'text.content'.

  • 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'm a newbie with pixi and am really enjoying it, I am creating a simple game but I cannot get the scoreboard to update dynamicaly, I can see the score increase in my console.log(score) but the number on screen remains at number 1. I have looked at online and at the manual and have tried .content but to no avail, what am I doing wrong ? I losing my hair Below is my basic script : var Container = PIXI.Container, autoDetectRenderer = PIXI.autoDetectRenderer, Graphics = PIXI.Graphics, Sprite = PIXI.Sprite, MovieClip = PIXI.extras.MovieClip, TilingSprite = PIXI.extras.TilingSprite, loader = PIXI.loader, resources = PIXI.loader.resources, Text = PIXI.Text; TextureCache = PIXI.utils.TextureCache, Texture = PIXI.Texture; //Create a Pixi stage and renderer var stage = new Container(), renderer = autoDetectRenderer(256, 256); document.body.appendChild(renderer.view); //Scale the canvas to the maximum window size var scale = scaleToWindow(renderer.view); //Set the initial game state var state = play; //load resources loader.add("images/player.png") .load(setup); //Define any variables that might be used in more than one function var gameScene = undefined, // container state = undefined; score =1; message = undefined; function setup() { gameScene = new Container(); stage.addChild(gameScene); message = new Text(score, {fill:"white"}); gameScene.addChild(message); state = play; //Start the game loop gameLoop(); } function gameLoop() { //Loop this function 60 times per second requestAnimationFrame(gameLoop); //Run the current state state(); //Render the stage renderer.render(stage); } function play() { score++; message.content = score; console.log(score); } Thanks in advance to anyone who can help me Eric
×
×
  • Create New...