talamask Posted November 12, 2018 Share Posted November 12, 2018 I kind of cannot understand why given example does not ends up with red texture. function modify(width, pixelSize) { let existingImage = this.textures.get("dude").getSourceImage(); let context = existingImage.getContext("2d"); for (var y = 0; y < width; y++) { for (var x = 0; x < width; x++) { context.fillStyle = "#f00"; context.fillRect(x * pixelSize, y * pixelSize, pixelSize, pixelSize); } } } I have checked that existingImage and context variables are populated ok, but calling this function does not produce desired result. Please assist. Link to comment Share on other sites More sharing options...
Recommended Posts