Help Adding Screen

Omniwang

Newbie
Sep 18, 2017
29
39
Hey, can someone save me a bit of frustration? This is my second VN and I'm trying to create a new screen like one of those ordering info splash pages you'd get in a shareware game. All of the references I see are for creating a page that displays content using the interface, but I just want it to call up the image. I've managed that, but then it stays there and won't let me return to the main menu.

I need a screen you can visit from the main menu and look at until you hit any key and return to the main menu (or the screen you were on previously). Thank you.
 

penecultor

Newbie
May 4, 2017
78
651
Have you tried adding a return button using an imagemap?

Like:

Code:
screen your_screen:
      add "bla/blabla/your_image.png" # the background image
      imagemap auto "bla/blihblah/returnButton_%s.png": # images you're gonna use for the button
             hotspot (1,2,3,4) action Return() # where (1,2,3,4) are the coords of your button
 
  • Like
Reactions: Alvidas

Omniwang

Newbie
Sep 18, 2017
29
39
I thought about the hotspot but I didn't want to change the image to include a back button. But you just made me think that the entire image could be the return hotspot. Thanks, that should put my thinking back on the right track.
 
  • Like
Reactions: penecultor

Alvidas

Newbie
Jul 2, 2018
35
15
Have you tried adding a return button using an imagemap?

Like:

Code:
screen your_screen:
      add "bla/blabla/your_image.png" # the background image
      imagemap auto "bla/blihblah/returnButton_%s.png": # images you're gonna use for the button
             hotspot (1,2,3,4) action Return() # where (1,2,3,4) are the coords of your button
Sorry for the beginner question. I tried your code, but I am doing something wrong because I am receiving an error.
The background image is loading fine, but I have trouble with the image map.
Also, could you explain please, "%s" role in your example "/returnButton_%s.png"?
I thought I could replace with a png but getting an error: "Typeerror: not all arguments converted during string formatting."

Code:
screen screen_test3:
      add "blondie1.png" # the background image
      imagemap auto "blondie1_S.png": # images you're gonna use for the button
             hotspot (1,2,3,4) action Return() # where (1,2,3,4) are the coords of your button
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,236
I need a screen you can visit from the main menu and look at until you hit any key and return to the main menu (or the screen you were on previously). Thank you.
Code:
screen myScreen:
    add "your image.png"
    imagebutton:
        xpos 0 ypos 0
        xsize config.screen_width ysize config.screen_height
        idle Solid( "#00000000" )
        action Return()
Click anywhere on the screen and you'll quit the screen.
And to display the screen :
Code:
label somewhere:
    call screen myScreen
or
Code:
screen someScreen:

    textbutton "show the screen":
        action Show( "myScreen" )


Also, could you explain please, "%s" role in your example "/returnButton_%s.png"?
It's the auto completion feature when using the auto property. :
This should be a string that contains %s in it. If it is, and one of the image properties is omitted, %s is replaced with the name of that property, and the value is used as the default for that property.

For example, if auto is "imagemap_%s.png", and idle is omitted, then idle defaults to "imagemap_idle.png". If auto is "imagemap %s", the imagemap idle image is used.