class Pettanr.Speech extends Peta.Element @singular: () -> 'Speech' @plural: () -> 'Speeches' defaults: { id: null, x: 0, y: 0, width: 100, height: 100 } @pick_item_name: () -> 'speech_balloon_template' @trace_routes: () -> { speech_balloon: 'speech_balloon', speech_balloon_template: ['speech_balloon', 'speech_balloon_template'], symbol: ['speech_balloon', 'speech_balloon_template', 'system_picture'] } pick: () -> # speech_balloon_template = @templates.speech_balloon_template writing_format = @templates.writing_format { speech_balloon_template_id: speech_balloon_template.get('id'), speech_balloon_template_module_name: speech_balloon_template.get('module_name'), writing_format_id: writing_format.get('id'), writing_format_module_name: writing_format.get('module_name'), } @text_align_texts: () -> ['left', 'left', 'right', 'center'] text_align_text: () -> Pettanr.Speech.text_align_texts()[@get('text_align')] scenario: () -> @boosts('read') @render(Pettanr.to_s(@get('content'))) plain_scenario: () -> @escape('content') initialize: (attr, options) -> super(attr, options)