Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Troubles with text

9 years ago

Okay, so ... I'm attempting to make a simple, black background with red text for a few pages, but due to the nature OF said pages, I have to do the majority of the text in scripting, so I figured I could just use HTML, and I ... don't exactly know how to do that for this. Right now, it looks like this:

If %ROLL =  1 THEN
BEGIN
$PAGETEXT := "Blahblahblahblah" + $PAGETEXT + "<html><style>body{background-color:black;}</style></html>"
END
%ATK := %STR + %ROLL + %WEP

I've tested a few things to make the font red in the first part, but I'm messing something up, apparently...

Troubles with text

9 years ago

Are you saying the given code works and you want to know how to make the text red?

If you want to make a specific piece of text red, put styled span tags around it: <span style="color:red;">red text</span>

Troubles with text

9 years ago

It won't work because of the quotes.
 

Troubles with text

9 years ago
Nevermind.

Troubles with text

9 years ago

xD ?

Troubles with text

9 years ago
I was thinking font colors.

You could always just cheat hard. Upload a black image and do $PAGETEXT := $PAGETEXT + ">body background='URL'<"

Where URL = Location of the image.

Troubles with text

9 years ago

It's not the background that's the problem, it's the text. I'm using a black background, so obviously I can't use default text, but all the text aside from the health indicators is in the scripts because it's a battle page, so it needs to be able to update.

Granted, I could still pull this off with on-page scripting, I just really, really don't want to.

Troubles with text

9 years ago

Oh yeah; well, you can always use single quotes instead.

Troubles with text

9 years ago

xD Good to know. Morgan's method works, though, and fits easily into the previous script... (which, I learned the solid color background script from you, btw, so thanks for that one.)

Troubles with text

9 years ago

To clarify the OP:

The current script for the background works fine, it's changing the color of the text in HTML scripting that I'm having trouble with. I'm able to do it with the title and the links just fine, but everything I've tried in my script either can't be validated or is, bizarrely, ineffective.

Troubles with text

9 years ago

The color of the existing text, or the color of the text you're adding via scripting?

If it's the text you're adding via script, just do >font color=#668899>Text>/font>

Except change the < brackets, because if I don't it just becomes this:

Text

Troubles with text

9 years ago

... Context, please?
 

Troubles with text

9 years ago

If you want to type brackets without them parsing as HTML, use the entities &lt; and &gt; to get < and >.

Troubles with text

9 years ago

Got it. ^_^

$PAGETEXT := "<html><style>body{background-color:black;color:red;}</style></html>" + $PAGETEXT

Troubles with text

9 years ago

=D Oh my God, Morgan, you're a genius! Thankyouthankyouthankyou! I think I love you. (Alright, I may need to dial my appreciation down a little bit, but that was insanely frustrating...) 

Troubles with text

9 years ago

No problem, glad I could help! ^_^

You should be able to drop stuff in before and after $PAGETEXT, too, as long as that HTML bit comes first. I'm guessing that's where your previous attempts went wrong.

Troubles with text

9 years ago

Actually, the HTML part does not need to come first. The way I have it set up is script text first, then HTML, then $PAGETEXT.

My previous issues were, apparently, because I was trying other HTML methods to change the text's color and ... while they're workable with other stuff, they do not work in the context I was using them in. Your method, thankfully, works perfectly.

Troubles with text

9 years ago

...man, I'm on a roll for accidentally solving problems I don't understand. XD

And yeah. Gotta love HTML. 9_9