super_frog Posted December 22, 2014 Share Posted December 22, 2014 Hello, I have a text and rectangle added to a group and group added to an array so I can later fetch any group.How can I change the rectangle color to, lets say, white? Thanks! Link to comment Share on other sites More sharing options...
klg Posted February 10, 2015 Share Posted February 10, 2015 Hi, I am trying to do the same thing. Were you able to figure this out? I want to update the color of rectangle on hover. I know I can use events for hover, but I'm not sure how to update the color. I tried mygraphic.graphicsData[0].fillColor = 0x5B5B5B;but this does not work. Thanks Link to comment Share on other sites More sharing options...
super_frog Posted May 21, 2015 Author Share Posted May 21, 2015 I did not figured out how to change rectangle color. I wanted to highlight rectangle where the action is, but left it without. Link to comment Share on other sites More sharing options...
drhayes Posted May 21, 2015 Share Posted May 21, 2015 When you say "rectangle", what is it? Is it an image? Was that image made using a BitmapData as a texture? Link to comment Share on other sites More sharing options...
super_frog Posted May 21, 2015 Author Share Posted May 21, 2015 Rectangle like game.add.graphics rectangle.var r = game.add.graphics(0,0);r.drawRectangle(...) Link to comment Share on other sites More sharing options...
drhayes Posted May 21, 2015 Share Posted May 21, 2015 I don't have a lot of experience using Graphics objects. This sounds dumb... but have you tried re-drawing the rectangle? Link to comment Share on other sites More sharing options...
super_frog Posted May 22, 2015 Author Share Posted May 22, 2015 I didn't tried that.I was first going to ask if the rectangle color can be changed because this will be much simpler than drawing it again. Link to comment Share on other sites More sharing options...
Recommended Posts