comic-bubbles
Version:
Animated comic bubbles - what else?
32 lines (24 loc) • 669 B
JavaScript
export class Body {
constructor(parent) {
this.parent = parent
this.text = undefined
}
getPrefStr() {
return this.parent === undefined ? 'body' : this.parent.getPrefStr() + '.body'
}
getWidth() {
return this.text.getWidth() + this.text.margin.left + this.text.margin.right
}
getHeight() {
return this.text.getHeight() + this.text.margin.top + this.text.margin.bottom
}
getX() {
return this.parent.getX() + this.parent.arrow.width
}
getY() {
return this.parent.getY() + this.parent.connector.getHeight()
}
setText(text) {
this.text = text
}
}