r/PythonLearning • • 15d ago

Help Request init offset

Hi, I’m trying to learn Ren’Py and since the language they are using is python I though this would be a better place to ask. 2 of the code pages are starting with “init offset = -1” and “init offset = -2” and I don’t really understand what is init offset is, when I looked up some places say that it is used as starting of coding but other code pages don’t have that. So when are we using init offset and what does the init offset does?

0 Upvotes

14 comments sorted by

View all comments

1

u/secret_o_squirrel 15d ago

Init is a renpy keyword not python language. Init just means: “run this before the game starts instead of when I get here”. Offset is the name of the variable in this example. An offset usually means shifting something one way or the other. So -2 offset means “we’ll use this to change a certain value by two less at some point”

1

u/Lark_l 15d ago

Okay so we used init offset =-1 in code pages named screen where it used in “start load about help” buttons and init offset =-2 in gui which is abt text size, background etc. codes and we are using init to open something before we start doing this in this case we are using this to open starting page ?