Jump to content

Search the Community

Showing results for tags 'change alpha'.

  • 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. In the code below I create a graphics object with an alpha of 0. I then create a tween object using the graphics object as the target. In the update function I change the alpha value of the graphics object from 0 to 1 using the tween. This does not work. However, when I create the graphics object using an alpha value of 1 and change the value from 1 to 0, using the tween, it does work. Can someone explain this to me? var MyGame={}; MyGame.Test=function(){ this.rectangle; this.tweenRectangle; this.switch=true; }; MyGame.Test.prototype={ create:function(){ this.rectangle=this.add.graphics(); this.rectangle.lineStyle(0); this.rectangle.beginFill(0x992d2d,0); this.rectangle.drawRect(0,0,600,600); this.rectangle.endFill(); this.tweenRectangle=this.add.tween(this.rectangle); }, update:function(){ if(this.switch){ this.tweenRectangle.to({alpha:1},5000,"Linear",true); this.switch=false; } } };
×
×
  • Create New...