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: 67
Joined: Fri Nov 28, 2014 10:22 am
Skype: kantonija
Contact:

how to style hyperlink

#1 Post by Qlara » Sun Apr 15, 2018 10:44 am

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
Image Carmilla
Demo Download: https://visualgothic.itch.io/carmilla-demo
Work In Progress here: viewtopic.php?f=43&t=48978

User avatar
Qlara
Regular
Posts: 67
Joined: Fri Nov 28, 2014 10:22 am
Skype: kantonija
Contact:

Re: how to style hyperlink

#2 Post by Qlara » Tue Apr 24, 2018 1:21 pm

Is there really nobody with an idea how to go about this?
Image Carmilla
Demo Download: https://visualgothic.itch.io/carmilla-demo
Work In Progress here: viewtopic.php?f=43&t=48978

User avatar
rayminator
Regular
Posts: 173
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

Re: how to style hyperlink

#3 Post by rayminator » Tue Apr 24, 2018 1:58 pm

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
Image

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

Re: how to style hyperlink

#4 Post by DannX » Tue Apr 24, 2018 2:17 pm

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: 67
Joined: Fri Nov 28, 2014 10:22 am
Skype: kantonija
Contact:

Re: how to style hyperlink

#5 Post by Qlara » Tue Apr 24, 2018 2:20 pm

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.
Image Carmilla
Demo Download: https://visualgothic.itch.io/carmilla-demo
Work In Progress here: viewtopic.php?f=43&t=48978

User avatar
Qlara
Regular
Posts: 67
Joined: Fri Nov 28, 2014 10:22 am
Skype: kantonija
Contact:

Re: how to style hyperlink

#6 Post by Qlara » Tue May 08, 2018 1:14 pm

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?
Image Carmilla
Demo Download: https://visualgothic.itch.io/carmilla-demo
Work In Progress here: viewtopic.php?f=43&t=48978

Post Reply

Who is online

Users browsing this forum: kivik, Majestic-12 [Bot], Milkymalk, Ocelot