Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Adding a Background to a page

7 years ago

I know there are a few forums on this but nothing seems to help my problem I'm not gonna lie and say I know some basic scripting because I don't. I simply just want to know how I can put a background on one of my pages not gobal or anything complicated and yes I do use advanced mode however despite the tries with the sources and pre-made background script nothing works and I'm kinda really amped to continue on but with knowing I can set a mood with the background.

I already have my pictures loaded and I don't know if I'm suppose you use the scripting option or can I just continue on using just the advanced mode. I don't have any other scripts running nor will I have nearing the future I just want to know how to set a background for one page so I know how to do it for others when I want different backgrounds. Thanks for the help!

Adding a Background to a page

7 years ago
$PAGETEXT := "[style]body{background: url('http://chooseyourstory.com/resources/images/user/XXXX');}[/style]" + $PAGETEXT

Put this in the Page Script of the page you want to do this on. Replace XXXX with the number that your image is (if you click the image in my pictures it should popup with a number).

Also replace the square brackets around "style" with < and >.

Adding a Background to a page

7 years ago

Just to make it easier if you are copy and pasting this, here is the version with the <>'s. 

$PAGETEXT := "<style>body{background: url('http://chooseyourstory.com/resources/images/user/XXXX');}</style>" + $PAGETEXT

Adding a Background to a page

7 years ago

Hah..Thanks for the help really I appreciated though I have one more request could you guys give me recommend place to learn how to script on this site specifically or some tips I'm really interested and learning and since those 3 months I know some basic stuff. laugh

 

Anyways thanks for the help if you don't have any recommendations then that's okay!

Adding a Background to a page

7 years ago

The Help and Info page has a bunch of articles about scripting. It's a good place to start.

Adding a Background to a page

7 years ago

Thanks

Adding a Background to a page

7 years ago

Killa_Robot, is there a way to make it so that your image doesn't repeat itself to fill the screen? (Like a quilt.)

Adding a Background to a page

7 years ago
Yeah, you just add it as an image on the page and edit its settings to either be in-line or in an absolute position (requires html knowledge). It would only appear once this way though.

Can also try adding this: background-repeat:no-repeat

To the original code (inside the style tags).

Adding a Background to a page

7 years ago

Thanks.

Adding a Background to a page

7 years ago

@Killa_Robot

I know it's been a while, but this code works really well for no repeating. And it also helps the picture not look stretched.

 

$PAGETEXT := "<style>body{background: url(??????) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}</style>" + $PAGETEXT

Adding a Background to a page

7 years ago
Cool. Knowing new methods is always handy, so thanks for letting us know.

Adding a Background to a page

7 years ago

Thanks for contributing new knowledge!

Adding a Background to a page

7 years ago

No problem.

Adding a Background to a page

6 years ago
This works for every page in the story? Where to you paste it?

Adding a Background to a page

6 years ago
If you want it on every page, put it in a global script.

Adding a Background to a page

6 years ago
Thanks. If I do that, can I put something else in another page without a conflict?

Adding a Background to a page

6 years ago
If you want to switch backgrounds out frequently you can use individual page scripts. If it's mostly the same one with just a few exceptions, you can probably create a variable for the global image and toggle it off when putting in a different one.

Please make sure your backgrounds aren't painful or obnoxious.

Adding a Background to a page

6 years ago
I will try.