Questions on making image menus, changing font, animation
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.
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.
Questions on making image menus, changing font, animation
I have a few questions that I need answered.
1. How can I make a menu where images are the options and can be on several different areas on the screen?
2. How do I change the font?
3. How can I animate a character walking toward where the player has clicked on a set path?
1. How can I make a menu where images are the options and can be on several different areas on the screen?
2. How do I change the font?
3. How can I animate a character walking toward where the player has clicked on a set path?
Re: Questions on making image menus, changing font, animation
I'm sorry, that is actually hard to do for a non-expert. I'll let somebody else answer that.Jukilum wrote:I have a few questions that I need answered.
1. How can I make a menu where images are the options and can be on several different areas on the screen?
Make sure you're in the same init block as the other style declarations in options.rpy2. How do I change the font?
Code: Select all
style.default.font = "nameofyourtruetypefont.ttf"
Unfortunately world map features are currently not yet available.3. How can I animate a character walking toward where the player has clicked on a set path?
Re: Questions on making image menus, changing font, animation
I can wait on #1.
#2, When I tried that on my last game I just edited the default line in the options, but it didn't work. Where does the font have to be located?
#3, Darn! Is there a way to at least animate on screen characters staying in one spot by using animated gifs or something?
#2, When I tried that on my last game I just edited the default line in the options, but it didn't work. Where does the font have to be located?
#3, Darn! Is there a way to at least animate on screen characters staying in one spot by using animated gifs or something?
Re: Questions on making image menus, changing font, animation
Animated GIF is not supported but as long as you can have all your frames in separate pictures (PNG or JPG depending on wether you want transparency or not), you should look into this : http://www.renpy.org/wiki/AnimationIs there a way to at least animate on screen characters staying in one spot by using animated gifs or something?
Ren'Py doesn't deal with adventure game concepts so such things will have to be done by hand ^^;
Re: Questions on making image menus, changing font, animation
K, that should work great for the animation!
Another question, how do you change the icon of your program so that it isn't just the girl with the snake?
Another question, how do you change the icon of your program so that it isn't just the girl with the snake?
Re: Questions on making image menus, changing font, animation
You can download a TrueType font from places like 1001freefonts or elsewhere. Place the .ttf file in the /game folder.Jukilum wrote: #2, When I tried that on my last game I just edited the default line in the options, but it didn't work. Where does the font have to be located?
Re: Questions on making image menus, changing font, animation
You can change the icon of the game window and the icon of the EXE.
For the exe : http://www.renpy.org/wiki/renpy/doc/tut ... 27Py_Games Before Packaging -> Change Exe Icon.
For the window : http://www.renpy.org/wiki/renpy/doc/ref ... _Variables config.window_icon
For the exe : http://www.renpy.org/wiki/renpy/doc/tut ... 27Py_Games Before Packaging -> Change Exe Icon.
For the window : http://www.renpy.org/wiki/renpy/doc/ref ... _Variables config.window_icon
-
- Veteran
- Posts: 359
- Joined: Sat Feb 25, 2006 11:09 am
- Location: Sant Cugat del Vallès (Barcelona, Spain)
- Contact:
Re: Questions on making image menus, changing font, animation
I would disagree with the "currently" part of this reply. Actually, world map support is deliberatelly not supported, as confessed by PyTom himself on http://lemmasoft.renai.us/forums/viewto ... ?f=8&t=982DaFool wrote:Unfortunately world map features are currently not yet available.Jukilum wrote: 3. How can I animate a character walking toward where the player has clicked on a set path?
However, there is hope yet... in the end, there is already an RPG written in Ren'py (Elven Relations, by Chronoluminaire), and I'm working on another onePyTom wrote:That Ren'Py isn't designed for RPGs doesn't help. (I've resisted adding support for a world map, for example... there are other tools more suitable for RPGs.)
Given two points, if you are able to define them as Ren'py Positions, you should be able to move something between them. If you need to move the sprite along a more complex path... well, here comes handy the fact that you can use python code to implement anything ren'py doesn't already do for you. I've not tested this yet, but even if it doesn't work properly it will at least give you an idea on how to approach the problem:
Code: Select all
def MovePath(sprite, path, time):
# sprite is anything you could feed to a show statement, normally an image or animation
# path is a list of positions to "visit" during the movement (like "checkpoints")
# time is how long you want the movement to take between consecutive points in the path
if len(path)>=2:
i = 0
while i+1 < len(path):
# I'm not familiar with the show function, so I'm not too sure about this call:
renpy.show(sprite, [Move(path[i], path[i]+1, time)])
renpy.pause(time) # wait until moved before moving the next step
i += 1 # Don't forget to increment the loop couter! (I always forget ^^' )
Code: Select all
$ image animation = Animation("frame_1.png", 0.25,
"frame_2.png", 0.25,
"frame_3.png", 0.25)
$ path = [(0, 0), (0, 1), (1, 1), (1, 0), (0, 0)]
$ MovePath(animation, path, 1.0) # this line does the movement
Isn't it? I think there is more...
No, that's all about moving and animating sprites...
Even so, there is a bit more :
Short answer: you just need to use an imagemap. Long answer: don't be lazy and click the link. The Ren'py documentation explains all you should need to use image maps and includes a simple, yet helpful, example .Jukilum wrote:1. How can I make a menu where images are the options and can be on several different areas on the screen?
Now, I'm really done.
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready
Re: Questions on making image menus, changing font, animation
Thanks! I think that should do it for me! The only thing I'm still wondering about is the font. I know that I already received an answer, but when I tried that in the first game I made it didn't seem to work. Unless the default options file has a flaw, I'm still confused. On a side note, after I finished my first game and started another, when I clicked on the edit script button nothing happens. Now I have to go open the files by hand (Oh no, manual labor!) So that must be a glitch.
I read something about being able to put some of the code in different files. Could someone explain that a bit more clearly to me please?
Thanks again for all of the help I have gotten!
I read something about being able to put some of the code in different files. Could someone explain that a bit more clearly to me please?
Thanks again for all of the help I have gotten!
-
- Veteran
- Posts: 359
- Joined: Sat Feb 25, 2006 11:09 am
- Location: Sant Cugat del Vallès (Barcelona, Spain)
- Contact:
Re: Questions on making image menus, changing font, animation
Taking as reference the options.rpy generated by default on Ren'py 6.6, on line 148, there is something like this:Jukilum wrote:Thanks! I think that should do it for me! The only thing I'm still wondering about is the font. I know that I already received an answer, but when I tried that in the first game I made it didn't seem to work. Unless the default options file has a flaw, I'm still confused.
Code: Select all
# style.default.font = "DejaVuSans.ttf"
1: Copy the font file into the game directory (the place where options.rpy and script.rpy are created by default).
2: Change in the options file the name of the file to the appropriate one.
3: Uncomment the line (remove the leading '#'), so Ren'py actually reads and executes it. (Did you do this?)
I've just tried to put the Comic Sans font included in Windows and it worked fine, so that's all.
Let's see... did you create the new game with the "New Project" option in the launcher? If you didn't, did you select it with the "Select Project" option? In either case, the name of the new project should be showing on the top-left corner of the launcher, in big font, and the "Edit Script" option should work properly. Maybe you created it outside the Ren'py's directory? Maybe a firewall is preventing Ren'py from invoking the editor?Jukilum wrote:On a side note, after I finished my first game and started another, when I clicked on the edit script button nothing happens. Now I have to go open the files by hand (Oh no, manual labor!) So that must be a glitch.
I tried to reproduce the problem, but it's working fine on my machine, so I cannot help you too much on this. If you can find a way to reproduce the problem, this would help to track it and find its cause (which is the essential step before finding the solution).
Ok... you can have as many script files as you want. The only requirement is that they must have a .rpy filename extension, and that they must be inside the game directory (where the script.rpy and options.rpy are). The way Ren'py works, there is no difference between having each block of code in its own file, or having everything on a single file (if you put everything that's on the options.rpy into the script.rpy, the game will work; only that the launcher will not know where to apply changes if you decide to change your game's theme). I think the script.rpy file is mandatory, but beyond that, it could perfectly be empty as long as you have a start label in one of your files. Note that all files are "mixed" together before parsing, so you cannot have two labels with the same name, and if you use the same variable name on two separate files it will (generally) refer to the same variable.Jukilum wrote:I read something about being able to put some of the code in different files. Could someone explain that a bit more clearly to me please?
From SciTE, you can create a new file, then save it as something.rpy in the game directory, and Ren'py will find it as part of your game from that point on. Finally, note that SciTE seems to be limited to 10 open files at a time: if you open an 11th, one of the previous ones is closed. So, if you have dozens of script files for your game, the "Edit Script" function from the launcher will become quite useless.
Hope this helps.
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready
Re: Questions on making image menus, changing font, animation
It helps very much, thanks! I did forget to remove the comment on the font.
I did everything as you said when I created it, it displays the name, but I don't think that it is a firewall considering that I can switch back to my first game and open the script again.Let's see... did you create the new game with the "New Project" option in the launcher? If you didn't, did you select it with the "Select Project" option? In either case, the name of the new project should be showing on the top-left corner of the launcher, in big font, and the "Edit Script" option should work properly. Maybe you created it outside the Ren'py's directory? Maybe a firewall is preventing Ren'py from invoking the editor?
I tried to reproduce the problem, but it's working fine on my machine, so I cannot help you too much on this. If you can find a way to reproduce the problem, this would help to track it and find its cause (which is the essential step before finding the solution).
-
- Veteran
- Posts: 359
- Joined: Sat Feb 25, 2006 11:09 am
- Location: Sant Cugat del Vallès (Barcelona, Spain)
- Contact:
Re: Questions on making image menus, changing font, animation
Have you checked that the files are actually there? They should be in <Ren'py folder>\<game's name>\game\. For a new project there should be a script.rpy and an options.rpy files there. If the files are on place, the launcher has the appropriate project selected, and the Edit Script button doesn't work, I have no idea what might be wrong there. I would think the problem is on your system rather than in Ren'py itself, because it seems to be happenning only to you, but this is still plain speculation.Jukilum wrote:I did everything as you said when I created it, it displays the name, but I don't think that it is a firewall considering that I can switch back to my first game and open the script again.
BTW, I guess you're using windows... and I could bet it's XP because around 70-80% of people runs WinXP (if not, it would be good to know what system are you on) If you're indeed on windows, make sure the project name doesn't have any unusual characters.. it's true that the old DOS limitations with filenames are supposed to be solved since Win95, but it's also true that unusual characters (anything beyond letters, digits, underscores, hyphens, and a single dot separating filename from extension) in filenames are causing problems every now and then, in each version of windows.
Also, you might also try to create another new project: if the "Edit Script" works with it, you can safely assume that the problem is only with that project; it's quite strange for it to work on one of the projects but not on the other, so it's worth to check one more to see what's the "norm" and what's the exception.
That's all I can come by; maybe if PyTom sees this might shed some light on the issue... I've wide experience in general Windows troubleshooting, but PyTom surely knows Ren'py better than me.
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready
Re: Questions on making image menus, changing font, animation
The files are definitely there, I've started to edit them. And actually, I'm using this on an OSX.
Who is online
Users browsing this forum: Bing [Bot]