[quick code] Heart popup

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
chungy
Regular
Posts: 26
Joined: Sun Sep 23, 2018 9:07 pm
Contact:

[quick code] Heart popup

#1 Post by chungy »

Heya! This is a super simple code that took me a few minutes of looking up to do, but I just wanted to post it for people (like me) who are usually too lazy to figure it out themselves! This heart does a little bounce, but you can define yours to just appear!

1.) Paste this into your options.rpy (I pasted it at the top);

Code: Select all

define config.layers = [ 'master', 'transient', 'screens', 'heartsposition', 'overlay' ]
This helps prevent the heart from getting caught behind the textbox!

2.) Define a position you want your heart to pop up as, here's mine for reference;

Code: Select all

transform heart:
    xpos 620
    ypos 780
    pause .15
    yoffset 0
    easein .175 yoffset 20
    easein .175 yoffset -20
I set my code to appear at the top of my text box! to adjust the position, just toy w/ the x/y pos code! (this is in script btw!)

3.) Showing your heart will look something like this (in my game);

Code: Select all

            show redheart onlayer heartsposition at heart with Dissolve(.5)
            hide redheart onlayer heartsposition with Dissolve(1)
This can be anywhere you want the heart to show up! That's about it!
https://gutrotz.itch.io/
Check out my itch.io!

viewtopic.php?f=62&t=52002&p=496592#p496592
Sprite commissions closed!

User avatar
Godline
Veteran
Posts: 499
Joined: Fri Jun 27, 2014 12:26 am
Completed: numerous
Tumblr: godlinegames
Deviantart: godline-games
itch: godline
Contact:

Re: [quick code] Heart popup

#2 Post by Godline »

Nice work! Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users