<function name="addStyleSheet" parameters="css">
AddExternalStylesheet("data:text/css," + urlEncode(css))
</function>
<function name="urlEncode" parameters="s" type="string">
<![CDATA[
s = Replace(s, "%", "%25")
s = Replace(s, " ", "%20")
s = Replace(s, "\"", "%22")
s = Replace(s, "#", "%23")
s = Replace(s, "$", "%24")
s = Replace(s, "&", "%26")
s = Replace(s, "'", "%27")
s = Replace(s, ",", "%2C")
s = Replace(s, ":", "%3A")
s = Replace(s, ";", "%3B")
s = Replace(s, "<", "%3C")
s = Replace(s, "=", "%3D")
s = Replace(s, ">", "%3E")
s = Replace(s, ">", "%3F")
s = Replace(s, "{", "%7B")
s = Replace(s, "}", "%7D")
return(s)
]]>
</function>
<game>
...
<css>
body {
background-color:black;
}
div#gameBorder {
background-color:black;
border-color:black;
}
</css>
...
</game>
addStyleSheet(game.css)
msg(game.css)
<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="reel">
<gameid>5b8e54c5-c011-417a-9ee5-b3c34be859e7</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<showborder type="boolean">false</showborder>
<attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
<autodescription_youarein_newline />
<appendobjectdescription />
<attr name="autodescription_youcango" type="int">0</attr>
<css>
img {
float:left;
padding:5px;
}
body {
background-color:yellow;
}
</css>
<attr name="external_state" type="int">0</attr>
<author>The Pixie</author>
<turn type="int">0</turn>
<subtitle>testing images</subtitle>
<start type="script">
addStyleSheet (game.css)
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<flag type="boolean">false</flag>
<description type="script">
if (this.flag) {
msg ("A big room, with wood-panelled walls. There is a large hole in the west wall, where the wood is blackeden.")
}
else {
msg ("A big room, with wood-panelled walls.")
}
</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<command name="clr">
<pattern>clr</pattern>
<script>
ClearScreen
</script>
</command>
<function name="addStyleSheet" parameters="css">
AddExternalStylesheet ("data:text/s," + urlEncode(css))
</function>
<function name="urlEncode" parameters="s" type="string"><![CDATA[
s = Replace(s, "%", "%25")
s = Replace(s, " ", "%20")
s = Replace(s, "\"", "%22")
s = Replace(s, "#", "%23")
s = Replace(s, "$", "%24")
s = Replace(s, "&", "%26")
s = Replace(s, "'", "%27")
s = Replace(s, ",", "%2C")
s = Replace(s, ":", "%3A")
s = Replace(s, ";", "%3B")
s = Replace(s, "<", "%3C")
s = Replace(s, "=", "%3D")
s = Replace(s, ">", "%3E")
s = Replace(s, ">", "%3F")
s = Replace(s, "{", "%7B")
s = Replace(s, "}", "%7D")
return (s)
]]></function>
</asl>
AddExternalStylesheet ("data:text/css," + urlEncode(css))