ADD and IMAGE

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
vossery
Newbie
Posts: 6
Joined: Wed Jan 02, 2013 1:12 am
Contact:

ADD and IMAGE

#1 Post by vossery » Wed Dec 12, 2018 1:36 am

What is difference between
image "image_name" xpos 10 ypos 10
and
add "image_name" xpos 10 ypos 10
for my screen?
What is better to use?

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

Re: ADD and IMAGE

#2 Post by Imperf3kt » Wed Dec 12, 2018 3:36 am

The first one won't work in a screen, you need to use add.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
vossery
Newbie
Posts: 6
Joined: Wed Jan 02, 2013 1:12 am
Contact:

Re: ADD and IMAGE

#3 Post by vossery » Wed Dec 12, 2018 9:10 am

They work both!

Code: Select all

screen main_menu:
    tag menu
    style_prefix "main_menu"
    image "images/test.png" xpos 400 ypos 200
and

Code: Select all

screen main_menu:
    tag menu
    style_prefix "main_menu"
    add "images/test.png" xpos 400 ypos 100

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

Re: ADD and IMAGE

#4 Post by Imperf3kt » Wed Dec 12, 2018 3:34 pm

Odd, never has for me. I guess I cannot say what the difference is then.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

rames44
Veteran
Posts: 232
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: ADD and IMAGE

#5 Post by rames44 » Thu Dec 13, 2018 2:43 pm

Well, the main difference is that “add” is documented, and “image” is not. There’s a good chance, therefore, that “image” is “old-style,” deprecated, and still works solely because PyTom tries not to break old code with new Ren’py releases when it can be avoided. There are any number of Ren’py constructs, functions, etc that have followed this pattern - replaced by something else, but still lurking in the Ren’py engine for backward compatibility.

User avatar
vossery
Newbie
Posts: 6
Joined: Wed Jan 02, 2013 1:12 am
Contact:

Re: ADD and IMAGE

#6 Post by vossery » Fri Dec 14, 2018 12:23 am

So, I must prefer add. Thanks!

rames44
Veteran
Posts: 232
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: ADD and IMAGE

#7 Post by rames44 » Fri Dec 14, 2018 1:31 pm

You’re always better off using “newer” than “older” when you can. Unfortunately, there are a lot of VERY old tutorials and examples out on the web, and Ren’py has evolved. So I always recommend that when people find examples “out there,” that they check them against the latest documentation and update accordingly.

Post Reply

Who is online

Users browsing this forum: Google [Bot], span4ev