Few simple suggestions

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
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Few simple suggestions

#1 Post by Kia » Fri Aug 01, 2014 9:44 am

Before I start I should mention that it's my first day and post here and my second day of using Ren'Py so if I asked for something that is already available forgive me I still lack experience.

since I stated using Ren'Py I loved how it makes everything easy to do but there are some things that are done the hard way so I decided to come and ask for a more simple way to do them (if there is not any).

1- image oprations:
when I tried to flip one of characters on the screen I found out that there is a whole creating a new image process for that.
can we get something like:

Code: Select all

show MyChar with im.Flip(vertical=False, horizontal=True)
and same thing for all of other oprations?

2- drag screen elements while in developer mode.
I was trying to find xpos and ypos for a little image on the screen in developer mode and said to myself: how easier this will be if i can just drag it to its position and see its x,y position in a corner of screen?

3- independent animations (and image bundles)
can we just make animations and then apply them to a bunch of pictures? like?

Code: Select all

bunch=imageBundle(img1,img2,img3,img4)
ani = Animation(0.25,0.5, 0.25,2)
show bunch with ani
image bundles can be used in ui.imagebutton too

4- it will be awesome if we can use animations for ui.imagebutton . please ^_^

5- independent ui elements (I'm not sure if this one is already available. I didn't find anything) like text and image buttons that are on the screen while characters speak and if clicked do something.

6- HotSpots
my experience with imagemap was awful can we have hotspots without any imagemap system please?

I'll be back with more suggestions after earning some more experience.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Few simple suggestions

#2 Post by xela » Fri Aug 01, 2014 10:35 am

None of the code is tested:
b3vad wrote:1- image oprations:
when I tried to flip one of characters on the screen I found out that there is a whole creating a new image process for that.
can we get something like:

Code: Select all

show MyChar with im.Flip(vertical=False, horizontal=True)
and same thing for all of other oprations?
Try:

Code: Select all

show expression im.Flip(ImageReference(MyChar), vertical=False, horizontal=True)
Otherwise, read up on renpy.show() function, that will work for sure.
b3vad wrote:Before I start I should mention that it's my first day and post here and my second day of using Ren'Py so if I asked for something that is already available forgive me I still lack experience.

since I stated using Ren'Py I loved how it makes everything easy to do but there are some things that are done the hard way so I decided to come and ask for a more simple way to do them (if there is not any).

2- drag screen elements while in developer mode.
I was trying to find xpos and ypos for a little image on the screen in developer mode and said to myself: how easier this will be if i can just drag it to its position and see its x,y position in a corner of screen?


Or you could display current coordinates of the mouse pointer in development mode like all sane people do (renpy.get_mouse_pos() or pygame.mouse.get_pos()) :)

b3vad wrote:3- independent animations (and image bundles)
can we just make animations and then apply them to a bunch of pictures? like?

Code: Select all

bunch=imageBundle(img1,img2,img3,img4)
ani = Animation(0.25,0.5, 0.25,2)
show bunch with ani
image bundles can be used in ui.imagebutton too
Search:

anim.TransitionAnimation()

also, I wrote python code to automatically animate from folders, assuming that all frames require the same pause between them:

Code: Select all

init python:
    import os
    gamedir = os.path.normpath(config.gamedir)

    def animate(path, delay=0.25, function=None, transition=None):
        # Build a list of all images:
        dirs = os.listdir("".join([gamedir, path]))
        images = list("".join([path[1:], "/", fn]) for fn in dirs if fn.endswith(('.png', '.gif')))
        # Build a list of arguments
        args = list()
        for image in images:
            args.extend([image, delay, transition])
        return anim.TransitionAnimation(*args)

    for dir in os.listdir("".join([gamedir, '/animations/'])):
        if " " in dir:
            renpy.image(dir.split(" ")[0], animate("".join(["/animations/", dir]), float(dir.split(" ")[1])))
        else:
            renpy.image(dir, animate("".join(["/animations/", dir])))
Default pause is 0.25 but if you want to change that, name your folder:

my_cool_animation 0.1

if you want to change that. Animation will be registered with Ren'Py under "my_cool_animation". There are some limitations to this and make sure the folder is called animations OR change that to whatever you please in code. Also make sure that images inside the folder could be logically sorted.
b3vad wrote:4- it will be awesome if we can use animations for ui.imagebutton . please ^_^
What's stopping you?
b3vad wrote:5- independent ui elements (I'm not sure if this one is already available. I didn't find anything) like text and image buttons that are on the screen while characters speak and if clicked do something.
Modify "say" screen in screens.rpy.
b3vad wrote:6- HotSpots
my experience with imagemap was awful can we have hotspots without any imagemap system please?
I am allergic to hotspots and believe that buttons are vastly superior (but it might be because I royally suck with graphics).
Like what we're doing? Support us at:
Image

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Few simple suggestions

#3 Post by Alex » Fri Aug 01, 2014 6:59 pm

Err, what version of Ren'Py do you use? Or maybe it's just a google search...
Anyway, this is the link to modern documentation - http://www.renpy.org/doc/html/index.html and cookbook that might be of a great help - http://lemmasoft.renai.us/forums/viewforum.php?f=51

As for your questions:
1. You can do it using ATL

Code: Select all

transform my_flip:
    xzoom -1

image MyChar= "eileen_happy.png"

label start:
    show MyChar at right, my_flip
    "?"
http://www.renpy.org/doc/html/atl.html

2. There was a project of making such framework for Ren'Py, but it seemed that author closed it.

4. Use animated displayables as idle and hover images for button

Code: Select all

image anim_img = Animation("img1.png", 0.2, "img2.png", 0.2)
image anim_atl_img:
    "img1.png"
    0.2
    "img2.png"
    0.2
    repeat
6. Mousearea is what you are looking for - http://www.renpy.org/doc/html/screens.html#sl-mousearea

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Few simple suggestions

#4 Post by Kia » Sat Aug 02, 2014 4:25 am

xela wrote: Try:

Code: Select all

show expression im.Flip(ImageReference(MyChar), vertical=False, horizontal=True)
Otherwise, read up on renpy.show() function, that will work for sure.
got syntax error ^_^.
xela wrote: Or you could display current coordinates of the mouse pointer in development mode like all sane people do (renpy.get_mouse_pos() or pygame.mouse.get_pos()) :)
with all of that align, pos and anchor things its really a pain to calculate the exact position that the picture must be when should be pixel perfect positioned so I can't be doing whatever sane people do.
xela wrote: also, I wrote python code to automatically animate from folders, assuming that all frames require the same pause between them:
this one should come handy thanks.
xela wrote: What's stopping you?
the "Missing Image" error.
xela wrote: Modify "say" screen in screens.rpy.
looks like lots of work but I'll look into it soon.
xela wrote: I am allergic to hotspots and believe that buttons are vastly superior (but it might be because I royally suck with graphics).
[/quote]
I'm allergic to them too but sadly I'm allergic to any block of code that exceeds 3 line too :cry: but I tried to make some clickable animated images on the screen while the chat is going on and I got all sorts of problems. still trying to figure it out.
Alex wrote: Err, what version of Ren'Py do you use?
6.17
Alex wrote: 1. You can do it using ATL
I'll look into it.
Alex wrote: 2. There was a project of making such framework for Ren'Py, but it seemed that author closed it.
Kia "sob... sob...."
Alex wrote: 4. Use animated displayables as idle and hover images for button
I've tried it already. looks like imagebutton don't see animations as an image.
Alex wrote: 6. Mousearea is what you are looking for
thanks. I'll try it soon.
_________________________________________________
I should thank for all the help and I know there is some way around everything but my point is: it's better to Improve the script language to do the common things and keep all of the coding in the background to keep it simple.

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Few simple suggestions

#5 Post by Kia » Sat Aug 02, 2014 4:39 am

well I figured out whats wrong with my animated button :mrgreen: sorry my bad. now I need to find a way to make it "not to stop the chat" or it's called focus or something right?

Post Reply

Who is online

Users browsing this forum: Bing [Bot], span4ev