Fennek Posted December 11, 2017 Share Posted December 11, 2017 Hello, Is it possible to color the background of a container without using graphics of any sort? Some kind of 'native' background color property or so? Thank you. Kind regards, Fennek Quote Link to comment Share on other sites More sharing options...
themoonrat Posted December 11, 2017 Share Posted December 11, 2017 A Container is nothing but a collection of other display objects, so cannot be visually represented itself. You need a Graphic or a Sprite (both of which inherit from Container) to even give the container dimensions in the first place Quote Link to comment Share on other sites More sharing options...
Fennek Posted December 11, 2017 Author Share Posted December 11, 2017 2 minutes ago, themoonrat said: A Container is nothing but a collection of other display objects, so cannot be visually represented itself. You need a Graphic or a Sprite (both of which inherit from Container) to even give the container dimensions in the first place Thank you for the reply. I'm looking at displaying over 10.000 text 'nodes', each with the same background color. Will each node exist of a smaller container with a graphic + the text that I want to display? Does this seem like a correct way to do this? Will having a graphic for every text node not affect performance? Since I am effectively doubling my object count then? Kind regards, Fennek Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 11, 2017 Share Posted December 11, 2017 set width/height of PIXI.Sprite with PIXI.Texture.WHITE Quote Link to comment Share on other sites More sharing options...
Fennek Posted December 11, 2017 Author Share Posted December 11, 2017 2 hours ago, ivan.popelyshev said: set width/height of PIXI.Sprite with PIXI.Texture.WHITE Tried this out but wasn't really what I'm looking for (or I'm missing something). Decided to try the graphic with text as a child. Will see how it goes with performance. Thanks in any case Quote Link to comment Share on other sites More sharing options...
OSUblake Posted December 12, 2017 Share Posted December 12, 2017 14 hours ago, Fennek said: Tried this out but wasn't really what I'm looking for (or I'm missing something). Did you set the width, height, and tint? var bg = new PIXI.Sprite(PIXI.Texture.WHITE); bg.width = 800; bg.height = 500; bg.tint = 0xff0000; nirmitleo and ivan.popelyshev 2 Quote Link to comment Share on other sites More sharing options...
Fennek Posted January 10, 2018 Author Share Posted January 10, 2018 On 12/12/2017 at 5:13 AM, OSUblake said: Did you set the width, height, and tint? var bg = new PIXI.Sprite(PIXI.Texture.WHITE); bg.width = 800; bg.height = 500; bg.tint = 0xff0000; Not sure why this didn't work then but it does now when I tried it again so thank you ivan.popelyshev 1 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.