Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Sun May 19, 2013 1:27 am

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu May 12, 2011 11:33 pm 
Newbie

Joined: Thu May 12, 2011 11:28 pm
Posts: 2
This is Tails007's boyfriend posting here. I've modified some of the code for her world map screen. The screen does show up, but buttons do not. However, buttons are functional now.

Code:
    screen NYBG1 :
        imagemap :
            ground "NYBG1.jpg"
            hover "button-1.png"
       
            hotspot (0, 0, 64, 64) clicked Return("Gym")
            hotspot (64, 0, 128, 64) clicked Return("Office")
            hotspot (64, 64, 128, 128) clicked Return("Study")
            hotspot (128, 64, 192, 192) clicked Return("go home")
       

   
     $ result = _return
   
     if result == "Gym":
        e "You went to the gym!"
        call screen GYM
     elif result == "Office":
        e "You went to your office!"
        call screen OFFICE
     elif result == "Study":
        e "You got schooled!"
        call screen SCHOOL
     elif result == "go home":
        e "I went home!"
        call screen HOME
       
    screen GYM
      e "working out"
      return
       
    screen OFFICE
      e "Working"
      return
     
    screen STUDY
      e "studying"
      return
     
    screen HOME
      e "resting"
      return

    return


The function 'call screen B1' returned an error so I removed it. Please help, she really wants to sell this game and use the money to make better ones.


Top
 Profile Send private message  
 
PostPosted: Fri May 13, 2011 9:35 am 
Regular

Joined: Sun Jul 26, 2009 5:06 pm
Posts: 40
Location: Leeds,England
Completed: none...yet
Projects: Heavens Falls (WIP)
Quote:
The screen does show up, but buttons do not. However, buttons are functional now.


thats a little confusing...

this might help its based on a image map

viewtopic.php?f=8&t=10152

_________________
~wolve~
My Blog and Demo's


Top
 Profile Send private message  
 
PostPosted: Fri May 13, 2011 9:20 pm 
Newbie

Joined: Thu May 12, 2011 11:28 pm
Posts: 2
If you could post more about how the code is supposed to work, that would be appreciated.

And I meant the buttons do work, but do not display overlapping images for them.


Top
 Profile Send private message  
 
PostPosted: Sat May 14, 2011 5:26 am 
Regular

Joined: Sun Jul 26, 2009 5:06 pm
Posts: 40
Location: Leeds,England
Completed: none...yet
Projects: Heavens Falls (WIP)
ahh basically it works with two images

first image
Image


second image with differant colored images
Image


using photoshop or gimp you need the x,y info of the images to help i have put dots at the corners

open and one of the images ive shown in photoshop or gimp and go to window info place your pointer at the red circle and it will tell you the info of the X and Y which is 13,13
then do the same for the green button 157,147

then do exactly same for other buttons yellow pink,blue black

so your code would look simler to this

Code:
label tut:

    # This is an imagemap. It consists of two images, and a list of
    # hotspots. For each hotspot we give the coordinates of the left,
    # top, right, and bottom sides, and the value to return if it is
    # picked.

    $ result = renpy.imagemap("tut1.jpg", "tut2.jpg", [
        (13, 13, 157, 147, "button1"),
        (176, 13, 319, 147, "button2"),
        (337, 13, 481, 147, "button3"),
        ], focus="imagemap")


hope that helps :)

so yeah you just basically need a copy of your first image and to alter color of button

_________________
~wolve~
My Blog and Demo's


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group