darren120 Posted August 4, 2021 Share Posted August 4, 2021 Hello, I am having trouble making image transparent. var gun = PIXI.Sprite.from('https://lh3.googleusercontent.com/proxy/1m3JwswvxsFQiPf0NGfFQ2zwdrs2Ynn2SCFRPwC2TdikKUNeUt6nEf-zkyV8Qn-cxZWWNEpboigze08R-gq4seJ-5P9RXgmbsaeyoaD1jVUCUAji1QnZTv4_wieLDpWjPSpe2ZVlXogs') Please help. thanks. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 4, 2021 Share Posted August 4, 2021 I'm sorry for meme-posting. Only photoshop or something like paint.net can help you, its not in the html5 scope. Quote Link to comment Share on other sites More sharing options...
darren120 Posted August 4, 2021 Author Share Posted August 4, 2021 Just now, ivan.popelyshev said: I'm sorry for meme-posting. Only photoshop or something like paint.net can help you, its not in the html5 scope. its ok. i thought we can apply something that recognizes the famous transparent sequence... man im gonna have to rethink my approach. I'll be using alot of images from another API and can't really ps everything Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 4, 2021 Share Posted August 4, 2021 Yes, its possible, if you know how to use canvas2d api and you can just FOR-it and change the image before it gets uploaded to webgl: how to use resource: https://pixijs.io/examples/#/textures/gradient-resource.js and about img - you can use pixi BaseImageResource/ImageResource as base or make a new one, just set the size of image when its loaded https://github.com/pixijs/pixijs/blob/55da4f04b3d5dba4a0f507550d25cb6335d975fa/packages/core/src/textures/resources/ImageResource.ts yes, we lack the full example of such thing, you have to understand texture resource code first Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.