Image map and image button questions. ALT

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
MRF
Newbie
Posts: 9
Joined: Thu Nov 08, 2018 7:49 am
Projects: Blurry
Contact:

Image map and image button questions. ALT

#1 Post by MRF »

Can i use alt on imagemap or imagebutton?
And one button on hover show two images individually.
I don't have access to computer right now, so i have this code in my mind. Im using my phone to make this post. I only have access to computer at school, i havr external hardisk but no laptop or computer my computer was sold a long ago.


The code in my mind:

Code: Select all

transform box_move:
    on show:
        #somethings
    on hide:
        #somethings 
transform text_move:
    on show:
        #somethings
    on hide:
        #somethings
image box_button_text:
#something 
image text_info_button:
#something 
Screen i_hate_doing_it_on_phone:
    tag menu
    imagemap:
        ground "images/something_idle.png
        hover" images/something_hover.png
        
        hotspot(100, 100, 200, 200) action Start() hovered [Play("Ch_costume_sounds", "sfx/test1.ogg), Show("box_button_text" at box_move, "text_info_button" at text_move)] unhover [Play("Ch_costume_sounds1", "sfx/test1.ogg"), Hide("box_button_text" at box_move, "text_info_button" at text_move)]
        
        hotspot(100, 100, 200, 200) action Quit(confirm=True) hovered [Play("Ch_costume_sounds2", "sfx/test1.ogg" ), Show("box_button_text1" at box_move, "text_info_button1" at text_move)] unhover [Play("Ch_costume_sounds3", "sfx/test1.ogg"), Hide("box_button_text" at box_move, "text_info_button" at text_move)]

#more sound channel. Why? So it's won't overlapping.
How should i do it? Define the image with alt?


-------Define images with alt first
|
V

Code: Select all

# darn it i forgot to give the transform an init - 2, im on my phone it's hard enough to give 4 space as an tab. everytime I'm on a new line
# I think tab = 4 spaces am i right? 


init - 2:    #######


#this init for the transform i forgot to write it first and so i won't give the following transform more 4 spaces
#too lazy to done that. 

transform box_trans:#on init block
    "box1.png" 
    alpha 0
    linear 0.3 alpha 1
    linear 0.3 alpha 0
    "box2.png"
    alpha 0
    linear 0.3 alpha 1
    linear 0.3 alpha 1   
     repeat
transform box_hide:
    "box1.png"  
transform text_info_trans: #on init block 
    "text1.png" 
    alpha 0
    linear 1 alpha 1
    linear 1 alpha 0
    repeat 
transform text_hide:
    "text1.png"
#is there's an easier way to make the transform. 
#i was going to use parallel but nope basicaly i want 
#tge image to blink and move
image box_button_text:
    on show:
        contains text_info_trans
        xpos -300 ypos 1
        linear 1 xpos 1
    on hide:
        contains text_hide
        xpos 1 ypos 1
        linear 1 xpos -300
image text_info_button:
    on show:
        contains text_info_trans
        xpos -300 ypos 1
        linear 1 xpos 1
    on hide:
        contains text_hide
        xpos 1 ypos 1
        linear 1 xpos -300
Screen i_hate_doing_it_on_phone1:
    tag menu
    imagemap:
        ground "images/something_idle.png
        hover" images/something_hover.png
        
        hotspot(100, 100, 200, 200) action Start() hovered [Play("Ch_costume_sounds", "sfx/test1.ogg"), Show("box_button_text", "text_info_button")] unhover [Play("Ch_costume_sounds1", "sfx/test2.ogg"), Hide("box_button_text", "text_info_button")]
        
        hotspot(100, 100, 200, 200) action Quit(confirm=True) hovered [Play("Ch_costume_sounds2", "sfx/test1.ogg"), Show("box_button_text1", "text_info_button1")] unhover [Play("Ch_costume_sounds3", "sfx/test2.ogg"), Hide("box_button_text", "text_info_button")]
    
If image buttons is it like this?
With the button it self moving*

Code: Select all

#using the define on the script above
transform button_drop:
     xpos 600 ypos -100
     linear 0.5 ypos 300
     linear 0.3 ypos 260
     0.7
     linear 0.2 ypos 300
Screen i_hate_doing_it_on_phone2:
    tag menu
    add #background 
    imagebutton:#button move
        auto "button_start_%s.png
        at buttun_drop
        focus_mask True
        action Start() 
        hovered Show("box_button_text", "text_info_button")# is this a thing on image buttons? 
        unhover Hide("box_button_text", "text_info_button")# is this a thing on image buttons? 
        hover_sound Play(" Ch_costume_sounds", "sfx/test1.ogg")
        unhover_sound Play(" Ch_costume_sounds1", "sfx/test2.ogg")# is this a thing? 
        activate_sound Play(" Ch_costume_sounds2", "sfx/test3.ogg")

    imagebutton:#button move
       auto "button_quit_%s.png
       
       pos(600, 550)
       #almost forgot i can use this better than xpos 600 ypos 550. Wait did i just write it? Oh yeah while here is this a thing xypos(600, 500)? 
       
       focus_mask True
       action Quit(confirm=True) 
       hovered Show("box_button_text1", "text_info_button1")# is this a thing on image buttons? 
       unhover Hide("box_button_text1", "text_info_button1")# is this a thing on image buttons? 
       hover_sound Play(" Ch_costume_sounds3", "sfx/test1.ogg")
       unhover_sound Play(" Ch_costume_sounds4", "sfx/test2.ogg")# is this a thing? 
       activate_sound Play(" Ch_costume_sounds5", "sfx/test3.ogg") 
     
Can someone test it? i cannot test it i have no personal computer/laptop or tell me is this right?

I don't even know why I'm giving you guys a screen shot of my phone writing this... Maybe i got bored and so I'm just going to do something hahaha sorry and sorry i bombarded you with script and nonsense of mine.


Notice: CAREFUL ABOUT THE TAB/SPACES
Edit: What a long post



Btw Thanks

User avatar
MRF
Newbie
Posts: 9
Joined: Thu Nov 08, 2018 7:49 am
Projects: Blurry
Contact:

Re: Image map and image button questions. ALT

#2 Post by MRF »

UPDATE:
I find out everything above is wrong. kinda so here what i do
first, define an image with its own ALT

Code: Select all

image gui_dot_bg_show:
    "gui/costume_gui/bg/gui_particle_bg_circle.png"
    pos(-300,-74)
    1
    linear 5 xpos 1281
    repeat
Every part of images you want to have the animations
then make a screen that only has add "the image"

Code: Select all

screen gui_main_menu_look:
    add "gui_dot_bg_show"
    add "gui_dot_bg_show1"
    add "gui_dot_bg_show2"
    add "gui_dot_bg_show3"
    add "gui_dot_bg_show4"
    add "gui_dot_bg_show5"
    add "gui_dot_bg_show6"
    add "gui_dot_bg_show7"
    add "gui_dot_bg_show8"
    add "gui_dot_bg_show9"
    add "gui_dot_bg_show10"
    add "gui_dot_bg_show11"
    add "gui_dot_bg_show12"
    add "gui_dot_bg_show13"
    add "gui_base"
    add "gui_base_frame"
    add "gui_frame_menu_bg"
    add "gui_button_start"
    add "gui_button_more"
    add "gui_button_quit"
    add "gui_female2_art"
    add "gui_female1_art"
    add "gui_male_art"
i have a lot of parts that i want to move
so i edit the main menu to an image map i don't know why this is just for experimenting tbh
I can make the button to imagebutton

Code: Select all

screen main_menu():
    tag menu
    add gui.main_menu_background
    use gui_main_menu_look # -- this what is the one who make that screen full of animation shown
    imagemap:
        ground "imap_idle.png"#the idle are invisible image
        hover "imap_hover.png"

        hotspot (14,179,237,83) action Start()
        hotspot (15,328,235,73) action ShowMenu("more")
        hotspot (38,471,193,67) action Quit(confirm=True)
the image ground have to be invisible but i think it will be easier to just use imagebutton
and so i have this i haven't try make the hover button show images.
2qhhon.gif
2qhhon.gif (2.68 MiB) Viewed 427 times
the characters
Male Character
Female 1 & Female 2

Post Reply

Who is online

Users browsing this forum: No registered users