1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00

log in constructor, additional comment

This commit is contained in:
Alain Pitiot 2023-07-19 09:55:49 +02:00 committed by GitHub
parent 30c937b213
commit 122250527c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,8 +45,16 @@ export class Progress extends VisualStim
this._addAttribute("type", type, PROGRESS_TYPES.BAR);
this._addAttribute("fillColor", fillColor, "lightgreen");
this._addAttribute("fillTexture", fillTexture, PIXI.Texture.WHITE);
if (this._autoLog)
{
this._psychoJS.experimentLogger.exp(`Created ${this.name} = ${this.toString()}`);
}
}
/**
* Setter for the progress attribute.
*/
setProgress (progress = 0, log = false)
{
this._setAttribute("progress", Math.min(1.0, Math.max(0.0, progress)), log);