keel Posted November 19, 2017 Share Posted November 19, 2017 Hi, I'm new to Pixi, I want to make a star background like this: But I can't find a way to make 'createRadialGradient' in Pixi, so how to create a star like that? please help. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 19, 2017 Share Posted November 19, 2017 Make it with canvas2d, then export texture to pixi with "BaseTexture.fromCanvas(myCanvas)" . Better if multiple stars of different sizes are on that canvas and you create regions for them (new PIXI.Texture with a frame), like an atlas. Even better if you make it in photoshop and export as png. Please read more threads, search stuff, read the docs, read pixi sources if you need. Quote Link to comment Share on other sites More sharing options...
keel Posted November 19, 2017 Author Share Posted November 19, 2017 Thanks a lot, I will try that. Quote Link to comment Share on other sites More sharing options...
keel Posted November 21, 2017 Author Share Posted November 21, 2017 I have done that with png file, here it is: Quote Link to comment Share on other sites More sharing options...
mattstyles Posted November 21, 2017 Share Posted November 21, 2017 beautiful, strong work Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 22, 2017 Share Posted November 22, 2017 There might be problems with scaling. You can try to load star from texture which has power-of-two width and height, that will enable mipmapping on it. If you need only left-top region of that texture, just do "new PIXI.Texture(oldTexture, new PIXI.Rectangle(0,0,newWidth,newHeight)" Quote Link to comment Share on other sites More sharing options...
keel Posted November 22, 2017 Author Share Posted November 22, 2017 Mipmapping is a good idea, but now I set the stars width and height in random size when create it. Should I make multiple size of stars in one pic? What's the problem with scaling? 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.