Jump to content

Search the Community

Showing results for tags 'scale mask'.

  • 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 working on a web app that receives jpg images from the server, and I need to resize the received image to the size of a mask .png image. I'm trying as follows, but I don't find the way to scale the image that I get from the cache. Can anyone help me? Thanks, // get the size of the mask .png image here var maskImage = game.cache.getImage('mainMask'); // make a bitmapData with that size var bmd = game.make.bitmapData(maskImage.width, maskImage.height); // get the image received from the server that must be masked var currImage = game.cache.getImage(cacheKey); // ======>>>>>>> scale / resize / crop the currImage here to match the mask image size, and put the result into the cache // apply mask bmd.alphaMask(cacheKey, 'mainMask'); // create the sprite var sprite = game.add.sprite(game.rnd.integerInRange(maskImage.width / 2, 1000), game.rnd.integerInRange(maskImage.height / 2, 1000), bmd);
×
×
  • Create New...