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

visual/VisualStim: Enable pixi updates when setting opacity #203

Merged
merged 4 commits into from Apr 9, 2021
Merged

visual/VisualStim: Enable pixi updates when setting opacity #203

merged 4 commits into from Apr 9, 2021

Conversation

thewhodidthis
Copy link
Contributor

@thewhodidthis thewhodidthis commented Oct 6, 2020

@apitiot @tpronk Tweak the onChange() callback for opacity to activate this._needPixiUpdate so that dynamically altering its value is picked up when _updateIfNeeded() gets called. Note also that ShapeStim's constructor needs no separate this._setAttribute() for opacity, closes #202 and closes #275

Sotiri Bakagiannis added 2 commits October 6, 2020 22:52
Not required, because opacity is one of the attributes passed on
to the parent class via super()
Copy link
Contributor

@apitiot apitiot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that this is necessary.

The mistake I made was to have _onChange(false, false) instead of _onChange(true, false) in ShapeStim.js since it is necessary to recreate the PIXI object when the opacity changes for a ShapeStim. However, I believe we do not need it systematically. For instance, changing the opacity of the MovieStim does not require a new PIXI object.

Shall we go over the stimuli and check when it is needed and when it is not? Let us try not to create/recreate PIXI objects when not necessary.

Alain

@thewhodidthis
Copy link
Contributor Author

@apitiot Having the tweak applied inside ShapeStim's constructor, not VisualStim's in general was the first thing I tried. Seems to be having no effect, you can visit the project below to confirm. Could it be something else is getting in the way? I have checked that opacity is kept off the super() call as a way to make sure the this._addAttribute() is respected?

run.pavlovia.org/thewhodidthis/rule_learning_fall2020_num_spa/html →

@apitiot apitiot merged commit bdcd4ac into psychopy:master Apr 9, 2021
@thewhodidthis thewhodidthis deleted the bf#202--opacity branch June 17, 2021 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants