Applying zoom to an imagebutton

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
Evildumdum
Regular
Posts: 191
Joined: Sun Jan 18, 2015 8:49 am
Projects: ApoclypseZ
Contact:

Applying zoom to an imagebutton

#1 Post by Evildumdum »

So i've started transforming using zoom. Hit a slight problem in that I can't work out how to apply the transform to an imagebutton. No matter how i try to use it, i always get the message that "zoom is not a keyword argument or valid child for the imagebutton statement."

If anyone can help or point me towards some material that might help i would be very grateful. I drew a blank in my search.

On a separate note, is it possible to apply zoom on an entire screen?
"If at first you don't succeed, try hitting it with a shoe."

User avatar
Alera
Miko-Class Veteran
Posts: 651
Joined: Sun Mar 21, 2010 3:20 am
Completed: Tortichki // Zayay // Hero's Spirit
Deviantart: psyalera
itch: psyalera
Location: UK
Contact:

Re: Applying zoom to an imagebutton

#2 Post by Alera »

I believe to make this work, you need to define the transform first and then apply it to the button. Something like this:

Code: Select all

init-2:
    transform zoomedin:
        zoom 2.0

screen buttonsandstuff:
    imagebutton:
        idle "button1"
        hover "button1_1"
        at zoomedin
To apply the zoom to the entire screen, I think you need to apply it to the layer.

Code: Select all

show layer master at zoomedin
I hope this helps?
Image
Games:
❤️ Zayay [Otome?][BxPlayer][NaNo 2013]
❤️ Tortichki [Drag&Drop mini game]

Other games I've worked on:
My Heart's Flame Emissary of Starlight Freedom From Silence Sickness
And many more unannounced/secret projects. (. .)

User avatar
Evildumdum
Regular
Posts: 191
Joined: Sun Jan 18, 2015 8:49 am
Projects: ApoclypseZ
Contact:

Re: Applying zoom to an imagebutton

#3 Post by Evildumdum »

Very much so. Just a quick question though. I get the show layer master at zoomed in, but i have no idea where it should be placed to get the desired effect. Does it go inside the screen itself of in the show / call for the screen?

I can apply the zoom to individual buttons now, but if a can zoom the whole screen it would save hours of programming and simplify alot of code.
"If at first you don't succeed, try hitting it with a shoe."

User avatar
Alera
Miko-Class Veteran
Posts: 651
Joined: Sun Mar 21, 2010 3:20 am
Completed: Tortichki // Zayay // Hero's Spirit
Deviantart: psyalera
itch: psyalera
Location: UK
Contact:

Re: Applying zoom to an imagebutton

#4 Post by Alera »

Sorry for replying late!

Ok, to apply the zoom to the whole screen simply add "show layer screens at zoomedin" after your 'start' label. But bear in mind that this will be applied to ALL screens you have showing. I'm not sure how to apply it to a single one unless you defined a separate layer for it or something like that.
Image
Games:
❤️ Zayay [Otome?][BxPlayer][NaNo 2013]
❤️ Tortichki [Drag&Drop mini game]

Other games I've worked on:
My Heart's Flame Emissary of Starlight Freedom From Silence Sickness
And many more unannounced/secret projects. (. .)

Post Reply

Who is online

Users browsing this forum: Google [Bot]