How to change image background ?
bramborak
23 Sept 2016, 08:33Hello, i am experiencing a problem with this particular java code. I tried to do the exact thing as it was in the java code template (SetImageBackground) but it is not working. Maybe i have some errors in the image file directory tree ? (I copied the tree from properties)Thanks for help and tips !
The Pixie
23 Sept 2016, 13:36The easiest way is to select the file on the Display tab of the game object.
If you need to do it in code, something like this:
JS.eval("$('#gameBorder').css('background-image', 'url(" + GetFileURL("gravestone.png") + ")');")
Change gameBorder
to the part of the display to change (try body
for example). gravestone.png is the file name; make sure it is in the same folder, if off-line.
By the way, Quest uses JavaScript, not Java.