Jump to content

Search the Community

Showing results for tags 'imagedata'.

  • 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 3 results

  1. I had made a codePen demo to show this case(and 2 screen-capture-images below) https://codepen.io/tomleader/pen/jOmNWJG There are 3 buttons(click to see the result) 1. use img: The most common way , sprite.from(imgUrl), everything is ok! 2. use buffer: a little tricky.. the process is [new a Image obj and set src=url, draw Image to another canvas, getImageData from canvas, make a texture from imgData buffer, sprite.from(texture)], and the result seems weird! 3. use dataUrl: the process is [new a Image obj and set src=url, draw Image to another canvas, canvas.toDataURL, make a texture from dataURL, sprite.from(texture)], and the result seems ok! So I think maybe the fromBuffer(imgdata) lost some pixels opacity data? OR I have some mistakes in my code? Any suggestions? Thanks ..
  2. var bmd = game.add.bitmapData(400, 400);var imageData = bmd.imageData;var d = imageData.data;for (var i = 0; i < d.length; i += 4) { d[i] = 0; d[i+1] = 255; d[i+2] = 0; d[i+3] = 255;}bmd.ctx.putImageData(imageData, 0, 0);green screen does not show! WHY??
  3. How do I go about adding a sprite to bitmap data? I can use bmd.draw('sprite');and that seems like it works but apparently the sprites pixels don't get added to the bitmap data so I can do things with it? I've also tried bmd.copy('sprite');And the image shows up initially but doing anything with bmd.processPixelRGB makes the added image disappear and evidently it's the pixels aren't actually added to bitmapdata?
×
×
  • Create New...