how to style hyperlink

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

how to style hyperlink

#1 Post by Qlara »

How do I make a link inherit the style of the screen's text (font, size)?
Or any other way to style it for a particular screen apart from inline.
For example, a screen with style prefix about, the following code does nothing.

Code: Select all

style about_hyperlink_text is about_text
style about_hyperlink_text:
    underline True
    hover_color gui.hover_color

User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: how to style hyperlink

#2 Post by Qlara »

Is there really nobody with an idea how to go about this?

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: how to style hyperlink

#3 Post by rayminator »

what does your code looks like the hyperlink maybe we can help better

if the link doesn't have hyperlink to it your style won't work

it the same thing as CSS coding

so if i was working on a website and I put this to it

don't try this it only example

Code: Select all

.hyperlink {
     background: url("images/background.jpg");
     background-position: 50% 50%;
     background-repeat: no-repeat;
     background-attachment: fixed;
    -webkit-background-size: cover; /* pour anciens Chrome et Safari */
     background-size: cover; /* version standardisée */;
     padding: 0;
}
here the link without class

Code: Select all

<a href="index.html">Home</a>
then i go to test it without class it won't show nothing

here is the link with class this will show the changes

Code: Select all

<a href="index.html" class="hyperlink">Home</a>
hope this help to understand

DannX
Regular
Posts: 99
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: how to style hyperlink

#4 Post by DannX »

I've been wondering about this as well (and I've been having a bit of trouble with styles myself).There seems to be nothing concrete about it in the documentation except a text style property that looks somewhat advanced, here. I'm sure there is a better way though, I'll have to keep testing.

User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: how to style hyperlink

#5 Post by Qlara »

Well, I have a number of links within text paragraphs on different screens. Each of these screens has different text formatting and I'd like the link to inherit that format, font style especially. From what I gather, links already inherit font size by default, but it's hard to tell when they don't inherit font style.

User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: how to style hyperlink

#6 Post by Qlara »

I was also familiar with that link to the hyperlink function, but it may just as well have been written in Chinese.
I would assume everyone needs to style their links somehow, if only to include the Ren'Py link in the credits, and yet no one has a solution here?

Post Reply

Who is online

Users browsing this forum: Google [Bot]