MCPcopy Create free account
hub / github.com/bwasti/mebm / init

Method init

script.js:507–536  ·  view source on GitHub ↗
(player, preview)

Source from the content-addressed store, hash-verified

505 }
506
507 init(player, preview) {
508 super.init(player, preview);
509
510 let settings = new Settings();
511
512 settings.add('text', null,
513 i => i.value = this.name,
514 e => this.update_name(e.target.value),
515 'textarea'
516 );
517
518 settings.add('color', 'color',
519 i => i.value = this.color,
520 e => this.color = e.target.value
521 );
522
523 settings.add('shadow', 'checkbox',
524 i => i.checked = this.shadow,
525 e => this.shadow = e.target.checked
526 );
527
528 let settings_link = document.createElement('a');
529 settings_link.style.float = "right";
530 settings_link.textContent = "[...]";
531 settings_link.addEventListener('click', function() {
532 popup(settings.div);
533 });
534 this.title_div.appendChild(settings_link);
535
536 }
537
538 update(change, ref_time) {
539 let rect = this.ctx.measureText(this.name);

Callers 2

initMethod · 0.45
addMethod · 0.45

Calls 3

addMethod · 0.95
popupFunction · 0.85
update_nameMethod · 0.45

Tested by

no test coverage detected