Adding an external stylesheet

JokesOnYou77
11 Dec 2013, 19:48
Hi all,

I'm new to quest and I'm tryign to make a very simple gamebook and I just want to add an external css stylesheet and have some kind of global css that I can edit. The tutorial on the wiki doesn't work and I've seen a couple of posts on the forums that deal with this but the solutions there don't seem to work for me either. I'm using Quest 5.4.1 and I thought that adding a basic stylesheet would be easy but that doesn't appear to be the case. Please help.

-- Jokes

The Pixie
11 Dec 2013, 21:04
I did a quick search of the Wki, and found the InitUserInterface function. My guess is that that is the way forward... You will just have to wait for the next version of Quest, as 5.5 is not out yet. It is supposed to be soon.

In the meantime, you could take a look at this, which changes the styles using JabaScript:
http://quest5.net/wiki/Modifying_the_UI_%28Advanced%29

JokesOnYou77
11 Dec 2013, 22:51
Thank you for your reply, Pixie. The injecting html in that wiki was the first thing I tried. But apparently the insert command doesn't work in 5.4 so that was a no go. The initUserInterface method does look promising but is also not a solution currently as you said (and the documentation isn't exactly thorough either). And I'm not really sure javascript is what I want either but I guess it could work.

Since I'm writing a game book I just have a collection of pages and it would be really nice to just make div tags with the classes I want and then alter them with a global css sheet. Is there really no way to do this??

Alex
11 Dec 2013, 23:38
You don't need to use the insert command to write HTML - you can now write HTML directly from msg.

e.g. (not tested)


msg ("<style> body {font-family: Comic Sans; } </style>")

george
12 Dec 2013, 07:25
I haven't used it with a gamebook but there actually is an inituser function in the current version. It works to an extent (it's not as good as the new version, which you can download from the nightly builds by the way -- https://quest.codeplex.com/releases/view/99971 ).