- Sep 18, 2018
- 835
- 1,736
I've fiddled around with this for about 3 hours trying everything I could think of, but I still can't get the text to align properly. Any advice would be greatly appreciated, because otherwise, I'll probably just have to scrap the whole dialog box idea entirely.
This is the macro I'm using in javascript:
Macro.add('dialog', {
tags : null,
handler : function () {
var content = this.payload[0].contents;
if (this.args.length > 1) {
var title = this.args[0];
this.args.deleteAt(0);
this.args.push('macro-' + this.name);
var classNames = this.args.join(' ');
} else if (this.args.length === 1) {
var title = this.args[0];
var classNames = 'macro-' + this.name;
} else {
var title = '';
var classNames = 'macro-' + this.name;
}
Dialog.setup(title, classNames);
Dialog.wiki(content);
Dialog.open();
}
});
// <<popup>> macro
Macro.add('popup', {
handler : function () {
if (this.args.length > 2) {
var passageName = this.args[0];
var title = this.args[1];
this.args.deleteAt(0, 1);
this.args.push('macro-' + this.name);
var classNames = this.args.join(' ');
} else if (this.args.length === 2) {
var passageName = this.args[0];
var title = this.args[1];
var classNames = 'macro-' + this.name;
} else if (this.args.length === 1) {
var passageName = this.args[0];
var title = '';
var classNames = 'macro-' + this.name;
} else {
return this.error('need at least one argument; the passage to display');
}
Dialog.setup(title, classNames);
Dialog.wiki(Story.get(passageName).processText());
Dialog.open();
}
});
This is my CSS:
div.dialog
{
border-style: solid;
border-width: 3px;
border-radius: 1em;
padding: 10px;
}
#trans
{
color: fuchsia;
font-weight: bold;
}
This is what the passage looks like:
<div class="dialog">[img[images/friends_mom/id.jpg]]<span id="trans">"Oh, hey $name, I didn't know you were coming over today. $gf and $bf are upstairs listening to some new album they got yesterday."</span></div>
This is what it looks like when playing it:
All I'm trying to do is move the text up a bit so that it's either aligned in the middle or the top of the image. Does anyone know what the hell I'm doing wrong?
This is the macro I'm using in javascript:
Macro.add('dialog', {
tags : null,
handler : function () {
var content = this.payload[0].contents;
if (this.args.length > 1) {
var title = this.args[0];
this.args.deleteAt(0);
this.args.push('macro-' + this.name);
var classNames = this.args.join(' ');
} else if (this.args.length === 1) {
var title = this.args[0];
var classNames = 'macro-' + this.name;
} else {
var title = '';
var classNames = 'macro-' + this.name;
}
Dialog.setup(title, classNames);
Dialog.wiki(content);
Dialog.open();
}
});
// <<popup>> macro
Macro.add('popup', {
handler : function () {
if (this.args.length > 2) {
var passageName = this.args[0];
var title = this.args[1];
this.args.deleteAt(0, 1);
this.args.push('macro-' + this.name);
var classNames = this.args.join(' ');
} else if (this.args.length === 2) {
var passageName = this.args[0];
var title = this.args[1];
var classNames = 'macro-' + this.name;
} else if (this.args.length === 1) {
var passageName = this.args[0];
var title = '';
var classNames = 'macro-' + this.name;
} else {
return this.error('need at least one argument; the passage to display');
}
Dialog.setup(title, classNames);
Dialog.wiki(Story.get(passageName).processText());
Dialog.open();
}
});
This is my CSS:
div.dialog
{
border-style: solid;
border-width: 3px;
border-radius: 1em;
padding: 10px;
}
#trans
{
color: fuchsia;
font-weight: bold;
}
This is what the passage looks like:
<div class="dialog">[img[images/friends_mom/id.jpg]]<span id="trans">"Oh, hey $name, I didn't know you were coming over today. $gf and $bf are upstairs listening to some new album they got yesterday."</span></div>
This is what it looks like when playing it:
All I'm trying to do is move the text up a bit so that it's either aligned in the middle or the top of the image. Does anyone know what the hell I'm doing wrong?