imagebutton without using screens?

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
bloobeary
Regular
Posts: 36
Joined: Fri Oct 04, 2019 3:02 pm
Deviantart: bloobeary
Soundcloud: user-212448702
Contact:

imagebutton without using screens?

#1 Post by bloobeary »

Is there a way to use an imagebutton without making a screen out of it?

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: imagebutton without using screens?

#2 Post by Per K Grok »

bloobeary wrote: Fri Oct 04, 2019 3:06 pm Is there a way to use an imagebutton without making a screen out of it?
Why do you not want to use a screen?

If you describe what it is you want to achieve it will be easier to help you. I expect that using an imagebutton without using a screen is what you see as the solution to a problem. If so, what is the problem you want to solve?

I suspect the best way to solve the problem might be to use a screen.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: imagebutton without using screens?

#3 Post by hell_oh_world »

bloobeary wrote: Fri Oct 04, 2019 3:06 pm Is there a way to use an imagebutton without making a screen out of it?
You can through the use of UI functions which are in the docs. But as what the above suggestions said, you should use screens for things like screen elements, try not to compromise if you can. So its better I guess to have your problem solved through screens rather than going onto this fallback option.

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: imagebutton without using screens?

#4 Post by isobellesophia »

Imagebutton always use screens, or it will not show the other screens that you've been using.
Actually, hotspots are different than imagebuttons, so imagebuttons aren't that hard until you really know about them or how to use it.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: imagebutton without using screens?

#5 Post by Remix »

Code: Select all

    show expression ImageButton('images/eileen.png', clicked=Notify('ding'), xpos=200)
The ImageButton class is a tad different to just screen language imagebutton though... find it in renpy/display/behavior.py
Frameworks & Scriptlets:

bloobeary
Regular
Posts: 36
Joined: Fri Oct 04, 2019 3:02 pm
Deviantart: bloobeary
Soundcloud: user-212448702
Contact:

Re: imagebutton without using screens?

#6 Post by bloobeary »

I figured out my problem. I was trying to create an imagebutton, but when it would be called onscreen the whole game would freeze until that button was clicked.

I needed to use show instead of call. So, the problem wasn't the screen, it was the way it was being displayed.

Post Reply

Who is online

Users browsing this forum: No registered users