Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to ask the handle if its value/state changed? #32

Closed
wighawag opened this issue Mar 30, 2017 · 1 comment
Closed

Is there a way to ask the handle if its value/state changed? #32

wighawag opened this issue Mar 30, 2017 · 1 comment

Comments

@wighawag
Copy link

I need to update something if the value change that I would not like to update every frame if possible.

I could store the previous value I guess but if zui could tell me if the value was updated that frame it would be great. If there is a current method (if even if it access private member I am all ears)

@luboslenco
Copy link
Member

Should now be doable using handle.changed property:

var hcombo = Id.handle();
ui.combo(hcombo, ["Item 1", "item 2"]);
if (hcombo.changed) {
	trace("Combo value changed this frame");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants