Is there any coding that can be used to change the colour of text in choicescript? Not for the entire game, that would just be an eyesore, but for certain parts of the game it would come in really useful.
ui.js
under the printx()
function thereās a handful of .replaces
, which is the easiest way to insert html. Just create your own. Noteworthy that anything outside standard ChoiceScript can pose a problem to publishing.
⦠Yeah, Iām going to be honest, I didnāt understand a word of that. Something to do with Javascript?
As another someone who also didnāt understand but a 'lil bit about that, I think I can explain it to you as this:
To change text colours, you have to modify one (or maybe more) of javascript file(s) which is basically another coding-work.
The problem is, youāll have to learn javascript coding-technique to not make any mistake while editing the file(s), and doing that means you canāt publish your WIP under Hosted Games nor CoG banner.
Yeah, coding in font color is too difficult for me. Itās already excruciating enough to struggle through CS code. Anyways, hereās a post that might help you:
Wow! I did not think that changing text colour would be so complicated. Maybe Iāll just keep it all the same.
Yea, basically we donāt support it yet, so if you want it, you have to hack it in.
(Looking back, yea, I kinda assumed a knowledge of the basic JavaScript architecture. Bad form on my part.)
I guess I can assume that it will be supported sooner or later?
P.S.: Ah, off-topic. NVM me :v
Lol. I guess most people who use Choicescript have a basic knowledge of Javascript too. Honestly, Iām just kind of figuring everything out as I go along.
Actually most donāt. Since I already started answering, let me see if I can expand.
In the web
folder, there is a file called ui.js
or (Although it may just say ui
with a JS File
as itās ātypeā). Thatās one of the JavaScript files CS uses to run. In it, the very first function is called function printx
. Indented in that function is a number of lines that say .replace(foo, bar)
where foo
is something like /</g
and bar
is something like '<'
Well that replaces the less than sigh <
with the HTML entity <
. Itās possible to mess with these (adding or removing some) to start writing HTML into a page.
The side effect is this gets very breakable, very fast.