Mortze wrote:I wonder if [...] there is a way to have different colors in the texts. Say, a description in the normal yellow, followed by what a npc would say in pink?
You can do it the following way:
- Code: Select all
<span style="color: #FF69B4">"I love you, Pumpkin."</span>
<span style="color: #FF7619">"I love you, Honey Bunny."</span> he says then stands up holding a gun, <span style="color: #FF7619">"All right, everybody be cool, this is a robbery!"</span>
<span style="color: #FF69B4">"Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"</span>
This will show up in game as:
"I love you, Pumpkin.""I love you, Honey Bunny." he says then stands up holding a gun,
"All right, everybody be cool, this is a robbery!""Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"Or with a much cleaner approach:
Add these to _style.css:
- Code: Select all
.pumpkin { color: #FF7619; }
.honey-bunny { color: #FF69B4; }
And the you'd just have to specify the class for the spans, and you could tweak the colors later if you don't like them simply by modifying the CSS. So the above stuff would be just:
- Code: Select all
<span class="honey-bunny">"I love you, Pumpkin."</span>
<span class="pumpkin">"I love you, Honey Bunny."</span> he says then stands up holding a gun, <span class="pumpkin">"All right, everybody be cool, this is a robbery!"</span>
<span class="honey-bunny>"Any of you fucking pricks move, and I'll execute every motherfucking last one of ya!"</span>
Mortze wrote:Also, if that doesn't exist, couldn't it be worth a thought for creators who would like to make games with moral aligned dialogues like in Mass Effect, blue for paragon, red for mercenary and white for neutral?
With the above trick you can do this manually. Or try something like the following snippet (add it to the end of your _game.js of "Dreaming with Elsa", it's tied to the black-and-white, etc variables and it will highlight most "renegade/paragon" dialogue options):
- Code: Select all
function gameBottomInit() {
"use strict";
var i, s, divs;
// Annotate dialogue responses.
divs = document.getElementsByTagName("table")[0].getElementsByTagName("a");
for (i = 0; !!divs && i < divs.length; i++) {
if (typeof divs[i].onclick === "function") {
s = divs[i].onclick.toString();
if (s.indexOf("'white'") > -1) {
divs[i].parentNode.style.boxShadow = "0 0 5px 0 #08f inset";
} else if (s.indexOf("'black'") > -1) {
divs[i].parentNode.style.boxShadow = "0 0 5px 0 red inset";
} else if (s.indexOf("'gray'") > -1) {
divs[i].parentNode.style.boxShadow = "0 0 5px 0 #fff inset";
} else if (s.indexOf("'silver'") > -1) {
divs[i].parentNode.style.boxShadow = "0 0 0 1px #ccc inset";
} else if (s.indexOf("'tin'") > -1) {
divs[i].parentNode.style.boxShadow = "0 0 0 1px #880 inset";
}
}
}
showScore();
debug();
}