Billy Williamton Posted September 5, 2016 Share Posted September 5, 2016 Tried generating a texture from a rectangle built using PIXI.Grapics and got a warning about it being deprecated and pointed me to canvas or render texture classes but even after reading the docs for them I'm not sure how to go from a generated graphics to a Texture. Quote Link to comment Share on other sites More sharing options...
themoonrat Posted September 5, 2016 Share Posted September 5, 2016 let graphic = new PIXI.Graphics(); // Make graphic however you want // renderer is what was returned when you first created the pixi renderer via 'let renderer = PIXI.autoDetectRenderer()' let texture = renderer.generateTexture( graphic); Rodrigo, ennix, jonforum and 1 other 3 1 Quote Link to comment Share on other sites More sharing options...
ennix Posted May 2, 2017 Share Posted May 2, 2017 On 5.9.2016 at 10:02 AM, themoonrat said: let graphic = new PIXI.Graphic(); // Make graphic however you want // renderer is what was returned when you first created the pixi renderer via 'let renderer = PIXI.autoDetectRenderer()' let texture = renderer.generateTexture( graphic); Shouldnt it be "new PIXI.Graphics()" instead of "new PIXI.Graphic()"? Pixi v4.x Quote Link to comment Share on other sites More sharing options...
themoonrat Posted May 2, 2017 Share Posted May 2, 2017 I do that on the first line Quote Link to comment Share on other sites More sharing options...
ennix Posted May 3, 2017 Share Posted May 3, 2017 Yes, but isnt it a typo? There is no Class "Graphic" in PIXI. Its "Graphics". Quote Link to comment Share on other sites More sharing options...
themoonrat Posted May 3, 2017 Share Posted May 3, 2017 oh, i see, yeah 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.