Moving an object offscreen at a diagonal?

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
bloobeary
Regular
Posts: 36
Joined: Fri Oct 04, 2019 3:02 pm
Deviantart: bloobeary
Soundcloud: user-212448702
Contact:

Moving an object offscreen at a diagonal?

#1 Post by bloobeary » Tue Oct 26, 2021 6:41 pm

Is it possible to move an object off the edge of the screen, by having it travel at a diagonal angle?

I'm thinking of doing a sort of "flyby" where a craft starts (at tiny size) near the left side of the screen, and then moves up and offscreen towards the top right while increasing in size. Sort of give the impression of it flying overhead.

I know that you can place anything anywhere onscreen by use of decimal locations from 0.0 to 1.0 on the x and y, but offscreen?

Is this possible?

Afterthought Addendum:
I suppose I could do it by using a mostly transparent image area larger than screensize and just enlarging it in total until the visible part was offscreen. I'm still interested in knowing if there are offscreen co-ordinates that can be used though.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Moving an object offscreen at a diagonal?

#2 Post by Ocelot » Tue Oct 26, 2021 7:01 pm

Code: Select all

show "starship.png":
    anchor (0.5, 0.5)
    pos (-1.0, 0.9)
    linear 10 pos (2.0, 0.1)
Will display image moving from bottomish left offscreen to top right offscreen.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot]