Making an image the background.

JennyKline
08 Jan 2016, 14:12
Heya Quest,

Trying something totally new, that I've not used the engine for before, but I want to set an image as the background for a page in a game book. I've inserted the image, but it leaves me with a lot of white space, so I just want to make the whole page an image.

What's the best way to do this, Gamebook mode?

OurJud
08 Jan 2016, 16:59
Do you mean so that all your text is overlayed on the image, or just so that your image fills the entire width?

Some screen shots would help make things clearer.

writtenhigh
09 Jan 2016, 04:56
I haven't played around with images inside Quest, or worked with Gamebooks yet, but depending on how Quest sets things up you could add the following CSS

#WHEREVERTHEIMAGEIS {background: url(YOURIMAGE) top left no-repeat; background-size: contain;} 


Just change WHEREVERTHEIMAGEIS to the element of the id that actually houses the background image, and change YOURIMAGE to the name of your image (and path, if images aren't stored in the same path as the other game files.)

With CSS, "contain" will fill as much space as possible with your image without cropping it. If you want to fill the whole space, but have part of your image cropped, use "cover" instead of "contain".

And, of course, if you're using an image that's much smaller than the space you're trying to fill, the quality will degrade as you stretch it.