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 »

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: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: ADD and IMAGE

#2 Post by Imperf3kt »

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

Twitter

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

Re: ADD and IMAGE

#3 Post by vossery »

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: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: ADD and IMAGE

#4 Post by Imperf3kt »

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

Twitter

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

Re: ADD and IMAGE

#5 Post by rames44 »

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 »

So, I must prefer add. Thanks!

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

Re: ADD and IMAGE

#7 Post by rames44 »

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: No registered users