television lines effect

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
Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

television lines effect

#1 Post by Gazza »

hello there, first time i'm posting here.

i was wondering, is it possible to add a filter on top of the screen (including gui and textbox) to simulate a old tv screen?

i searched the forum but i didn't find any doable solution.

thanks in advance

User avatar
lil steffi
Newbie
Posts: 8
Joined: Sun Oct 07, 2018 1:12 pm
Contact:

Re: television lines effect

#2 Post by lil steffi »

you could just do a transparent png animation and layer that on top of your scene!

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: television lines effect

#3 Post by Gazza »

i just created a custom screen and added my file but nothing is showing

sorry i'm not very flexible with screens

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: television lines effect

#4 Post by Imperf3kt »

Wanda Siren wrote: Sun Oct 07, 2018 5:43 pm i just created a custom screen and added my file but nothing is showing

sorry i'm not very flexible with screens
If you are able to show how you did so, we may be able to point out what went wrong.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
lil steffi
Newbie
Posts: 8
Joined: Sun Oct 07, 2018 1:12 pm
Contact:

Re: television lines effect

#5 Post by lil steffi »

I guess if you wanted to do a frame animation of the tv, you could treat it as a layer like this:


#define animations

image TVWarp:
"image1.png"
pause .5
"image2.png"
pause .5
"image3.png"
pause .5
repeat

#define your background

image your_background = "background.png"

#call the animations within whatever you're going to label it

label whatever:
scene your_background
show TVWarp



something like that could work for you

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: television lines effect

#6 Post by Gazza »

Imperf3kt wrote: Sun Oct 07, 2018 6:24 pm
If you are able to show how you did so, we may be able to point out what went wrong.

Code: Select all

screen over_image:

    zorder 300

    add "gui/overlay/static.png"
i only wrote this line of code over the other codes in screens.rpy, but i'm stuck

lil steffi wrote: Sun Oct 07, 2018 9:49 pm I guess if you wanted to do a frame animation of the tv, you could treat it as a layer like this:


#define animations

image TVWarp:
"image1.png"
pause .5
"image2.png"
pause .5
"image3.png"
pause .5
repeat

#define your background

image your_background = "background.png"

#call the animations within whatever you're going to label it

label whatever:
scene your_background
show TVWarp



something like that could work for you

wait, i meant like an image that stays on top of the screen for the rest of the game, even when you open the main menu or the settings

i'm not sure labels can do that, correct me if i'm wrong

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: television lines effect

#7 Post by Donmai »

You can create a new layer and show your image there.

Code: Select all

image scanlines = "images/your image.png"

Code: Select all

init python:
    config.layers = [ 'master', 'mask', 'transient', 'screens', 'overlay' ]

Code: Select all

label start:
    
    show scanlines onlayer mask
    rest of your game...
See here: viewtopic.php?f=8&t=20699

You can also experiment with alpha and/or additive values to fine-tune the effect. For example:

Code: Select all

image scanlines:
    "images/your image.png"
    additive .5
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: television lines effect

#8 Post by Gazza »

Donmai wrote: Mon Oct 08, 2018 11:05 am You can create a new layer and show your image there.

Code: Select all

image scanlines = "images/your image.png"

Code: Select all

init python:
    config.layers = [ 'master', 'mask', 'transient', 'screens', 'overlay' ]

Code: Select all

label start:
    
    show scanlines onlayer mask
    rest of your game...
See here: viewtopic.php?f=8&t=20699

You can also experiment with alpha and/or additive values to fine-tune the effect. For example:

Code: Select all

image scanlines:
    "images/your image.png"
    additive .5

okay so, i added your code in my script, and everything works fine, but it's not showing over my gui nor the title screen, am i doing something wrong? sorry for my ignorance

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: television lines effect

#9 Post by Donmai »

Wanda Siren wrote: Mon Oct 08, 2018 12:20 pmam i doing something wrong?
No, you are not. That's how that example really works, sorry.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

TakeHomeTheCup
Newbie
Posts: 15
Joined: Tue Oct 09, 2018 9:12 pm
Contact:

Re: television lines effect

#10 Post by TakeHomeTheCup »

You can use:

Code: Select all

label before_main_menu:
	show scanlines onlayer mask
	return
Along with that, you can put the layer 'mask' as the last element in the config.layers, like this:

Code: Select all

init python:
    config.layers = [ 'master'', 'transient', 'screens', 'overlay', 'mask' ]
However, even with that, you'll have to put "show scanlines onlayer mask" every time you change the scene, because when that happens, the layer is cleared, and I don't know if there is a way to prevent it from being cleared. Sorry.

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: television lines effect

#11 Post by Gazza »

TakeHomeTheCup wrote: Tue Oct 09, 2018 9:30 pm You can use:

Code: Select all

label before_main_menu:
	show scanlines onlayer mask
	return
Along with that, you can put the layer 'mask' as the last element in the config.layers, like this:

Code: Select all

init python:
    config.layers = [ 'master'', 'transient', 'screens', 'overlay', 'mask' ]
However, even with that, you'll have to put "show scanlines onlayer mask" every time you change the scene, because when that happens, the layer is cleared, and I don't know if there is a way to prevent it from being cleared. Sorry.
that's exactly what i wanted to do, it even shows on the setting screen!

it's ok if have to declare it every time, thank you very much for your help <3

Post Reply

Who is online

Users browsing this forum: No registered users