Ezelia / EZGUI

EZGUI - The missing GUI for Pixi.js and Phaser.io
http://ezgui.ezelia.com
440 stars 95 forks source link

Unable to dynamically edit component's settings object #40

Closed hiker-who-codes closed 8 years ago

hiker-who-codes commented 8 years ago

I am trying to dynamically edit the bg property from a EZGUI.components component, but have no luck yet.

I am unable to make the changes appear on screen. I can successfully access the component with: EZGUI.components[id]. This allows me to e.g. change the position property, and this change appears directly on the screen. However, when I try to do the same from the bg property, nothing happens.

I have found a _settings object and a settings object, both hold the bg property, but changing them has no effect. The component holds no bg property on its own.

The initial background does successfully appear through the JSON file. It just seems static afterwards.

Am I overlooking something obvious, or is it not yet implemented? Thanks!

alaa-eddine commented 8 years ago

if you edit the settings, you need to rebuild the component to reflect the changes : EZGUI.components[id].rebuild()

it's still undocumented because it's experimental, but it should work just fine :)

hiker-who-codes commented 8 years ago

Thanks, this works just fine!