if (UCase(answer)="TRUE") {
AddExternalStylesheet ("http://astral.zz.mu/style-black-online.css")
}
else {
AddExternalStylesheet (GetFileUrl("style-black-offline.js"))
}
JS.testOnline ()
caberg wrote:don't know where i must put this topic on, if i'm wrong please move this thread to correct section.
this just a psd mockup but i'll make this mockup for my first new game using Quest.
i'll share the code when finished, i hope not too long. lol.
sorry for my bad english, not my mother language.
<div style="background-image:url(background2.gif) url(www.test.com/pictures/background2.gif); margin:0px; padding:10px">
Pertex wrote:But if you host the images it will not work in the offline version any more
Is it possible to do something like this with css?
<div style="background-image:url(background2.gif) url(www.test.com/pictures/background2.gif); margin:0px; padding:10px">
So if it does not find the local background2.gif it would search for http://www.test.com/pictures/background2.gif ?
caberg wrote:"Pertex"
But if you host the images it will not work in the offline version any more
Is it possible to do something like this with css?
<div style="background-image:url(background2.gif) url(www.test.com/pictures/background2.gif); margin:0px; padding:10px">
So if it does not find the local background2.gif it would search for http://www.test.com/pictures/background2.gif ?
well i think i'll stick to place the images in game folder, i think that's will work in both offline and onlines games, what do you think ?
Mareus wrote:
Hey! I noticed a small bug. Look at my screenshot. The arrows seem to be white for some reason:
If you use something like this
AddExternalStylesheet(GetFileURL("style.css"))
Quest crashes on play. However, if you change the .css file to .js and then use
AddExternalStylesheet(GetFileURL("style.js"))
Then Quest doesn't crash, and it loads the CSS inside the file just fine. (Only in the offline version.)
<link type="text/css" rel="stylesheet" href="http://textadventures.blob.core.windows.net/gameresources/b6ac1788-fd2e-4e21-886f-614713a131a0/style-black.js">
Pertex wrote:There seems to be two problems.
1: css files are not included in .quest files
2: external style sheet files within .quest files seam to be not loaded when playing online
I can't find a crash when using .css files but perhaps it could crash when it tries to load a stlye sheet file which is not in the .quest file.
But I found a way to do both. Your offline version seems to work perfectly. For the online version you have to copy the images on an other server. Additionally you need to copy the css file and change the urls of the images towards the other server.
In your game file you can check if you are playing off- or online and load the correct css file.
Here are the game files with the images. You have to change the serveraddress in the aslx file
blackui.zip
And here is the css file to be copied to the external server (with all images). You have to change the serveraddress
style-black-online.zip
THere are only some problems with scrollbars in the online version