A downloadable phone code

Download NowName your own price


Sorry I can't provide any tech support for any troubles you have.

  • free to use, crediting me is appreciated but not required
  • based on the code found in cute demon crashers
  • supports menus and images
  • designed for 1920 x 1080, but if you play with the numbers enough you can make it work for any size
  • uh windows only i guess? i just zipped the whole renpy project idk if it works on other OS's lol
  • done with and for renpy version 6.99.14.3135 
  • example of how you can write the code in your dialogue
call message_img("nadia", "it works with images too!","images/pic1.png")
call message_img("nadia", "receive cute pics from your friend","images/pic2.png")
call message("nadia", "the text box changes depending on how much content there is. dont put too big images or its gonna look weeeeiiiird")
call message("nadia", "you can also do menus here")

i hope you enjoy!

StatusReleased
CategoryAssets
Rating
Rated 4.8 out of 5 stars
(43 total ratings)
Authornadia nova
Made withRen'Py
Tagsasset, Ren'Py, sourcecode

Download

Download NowName your own price

Click download now to get access to the following files:

phone template new.zip 1 MB

Development log

Comments

Log in with itch.io to leave a comment.

ngl it tripped me out when I saw my name, it's not that commonly used on the net.

But jokes aside, thanks so much for this! it really added that missing touch to my VN ^^

Can it also work for my version if 7.5.2 in Ren'py?

(1 edit) (+1)

Hello, is it possible to tweak your asset for my game? I want to change several things

Hey, i can't understand how to display menus in phone mode... Any help

Can confirm it works in Ren'Py 8 just fine, love how easy it is to implement in my recent vn!

I can't use this no matter how I run it. be it just copying everything word for word, or moving the file to my game file. I'm sorry if I offended you, but it seems cool!

Thank you so much for this! This just made my life a little bit easier! I cant wait to incorporate it into my game :)

Hi! I have managed to integrate your code, I like the way it looks, but I have a problem!

I don't know how to mark it for Renpy to translate it!

When I add _( ), in different ways it gives me error, and if I leave it without that (like any dialog) Renpy ignores it when translating it!

thanks in advance!

(+1)

So, the default phone image is "images/phone.png", but the .zip file contains several folders under "Images/mobile". Is there a way for me to know which backgrounds/images are supposed to be for which definitions?

Hi! Is there a way to make differently colored/multiple message frames? I want to make two new boxes for each character and am having trouble with figuring it out. Thanks!

Hey! Did you ever figure it out? I was wondering the same thing!

Hi! Thank you so much for making this! It looks so clean and nice! I was just wondering how I could change the font, size, colour etc for the name (such as "Me") that accompanies the messages? I tried playing around w the code but I kept getting errors :')

ah, nevermind, i think i am supposed to change it in screens.rpy!! i'm going to do it there and see how it goes :D

(1 edit) (+7)

For those using 1280 x 720, revised code:


Screens code:


init 5:
    style phone_message_vbox:
        xalign 0.5
        yalign 0
        ypos 150
        xsize 260
        
        
    style phone_message_frame:
        background Solid("#d9398c")
        ypadding 10
        xpadding 10
        
    style phone_message_frame2:
        background Solid("#78E8A0")
        ypadding 10
        xpadding 10

    style phone_message_contents:
        spacing 10

    style phone_message is say_dialogue:
        xoffset 0
        outlines []
        xalign 1
        yalign 0
        
    style phone_message2 is say_dialogue:
        xoffset 0
        outlines []
        xalign 1
        yalign 0
        
        
    style phone_message_who is phone_message:
        color "#ecf0f1"
        size 21

    style phone_message_what is phone_message:
        color "#ffffff"
        size 20
    style phone_reply is default:
        size 18
        xalign 0.5
        xsize 275
        background Solid("#666")
        hover_background Solid("#78E8A0")
        ypadding 10
        xpadding 10
        
        
screen phone_message(who, what):
    vbox at incoming_message:
        style_group "phone_message"
        add "images/bubble-tip.png" at phone_message_bubble_tip
        
        frame:
            style_group "phone_message"
            
            vbox:
                style "phone_message_contents"
                text who style "phone_message_who"
                text what style "phone_message_what"

screen phone_message2(who, what):
    vbox at incoming_message:
        style_group "phone_message"
        xoffset -384        
        xalign 1.0
        # this one adds the triangular tip for the bubble, if you change colors you change this images too
        add "images/bubble-tip2.png" at phone_message_bubble_tip2
        
        frame:
            style_group "phone_message2"
            background Solid("#78E8A0")
            xsize 200
            
            vbox:
                style "phone_message_contents"
                text who style "phone_message_who"
                text what style "phone_message_what"
                
screen phone_message3(what):
    vbox at incoming_message:
        style_group "phone_message"
        xoffset -384        
        xalign 1.0
        # this one adds the triangular tip for the bubble, if you change colors you change this images too
        add "images/bubble-tip2.png" at phone_message_bubble_tip2
        
        frame:
            style_group "phone_message2"
            background Solid("#78E8A0")
            xsize 200
            
            vbox:
                style "phone_message_contents"
                ##text who style "phone_message_who"
                text what style "phone_message_what"
                
screen phone_reply(reply1, label1, reply2, label2):
    modal True
    vbox:
        xalign 0.529
        yalign 0.65
        spacing 2
        
        textbutton "[reply1]" action Jump(label1) style "phone_reply"
        textbutton "[reply2]" action Jump(label2) style "phone_reply"

# here is a new menu that has more options than two
# basically i just added one more textbutton here, and the additional labels needed in the call 
# if you wish to make a menu with one or four just copy the code below and modify it a bit       
screen phone_reply3(reply1, label1, reply2, label2, reply3, label3,):
    modal True
    vbox:
        xalign 0.5
        yalign 0.8
        spacing 5
        
        textbutton "[reply1]" action Jump(label1) style "phone_reply"
        textbutton "[reply2]" action Jump(label2) style "phone_reply"
        textbutton "[reply3]" action Jump(label3) style "phone_reply"
        

style phone_reply_text:
    xalign 0.5

screen phone_message_image(who, what, img):
    vbox at incoming_message:
        style_group "phone_message"
        # this one adds the triangular tip for the bubble, if you change colors you change this images too
        add "images/bubble-tip.png" at phone_message_bubble_tip
        
        frame:
            style_group "phone_message"
            
            vbox:
                style "phone_message_contents"
                text who style "phone_message_who"
                text what style "phone_message_what"
                add img
                

############# phone code ends ############


In Options:

Change this part only (right at top of code):


# Picking up the phone
transform phone_pickup:
    yalign 1.0 xalign 0.5
    yoffset 900
    easein 0.3 yoffset 0




ALSO:

* Resize the images provided, including the phone image - the ones provided are too big.

Wow, thanks alot! Could you by any chance give me the new sizes you gave to the images? (The phone template and the bubbles)
Thanks!

(+3)

Yeah of course, the phone is 400x720, the in-message images are 150x150 but could probably go a little bigger if wanted. The text bubbles will resize themselves of course.

You’ll want to change this part in ‘Options’ if using my exact sizes:

 

# Picking up the phone

transform phone_pickup:

    yalign 1.0 xalign 0.5

    yoffset 900

    xoffset 32

    easein 0.3 yoffset 0

 


Link to resized phone: https://filebin.net/ak2vthastxrlw9wt

Thanks!

Hi, i need urgent help: text bubbles didn't resize themselves. They are literally out of the phone image and...idk what to do with it...please help!!

Are you a) using screen size 1280 x 720, and b) following all of my directions in the Options and Screen scripts above

Yes, i am doing 1280x720 and i literally copied the stuff you wrote here... The messages are still not resized.

THANK YOU!

I was trying to use this for my game and it keeps giving me an error when I try to launch the project. I've checked to make sure I have the right code for scripts and I used the code provided in the file as reference while I worked on it. I'm not sure what the problem is.

The error i got :


I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 37, in script call
    call phone_start
  File "game/script.rpy", line 37, in script call
    call phone_start
ScriptError: could not find label 'phone_start'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 37, in script call
    call phone_start
  File "C:\Users\Jareth\Desktop\program stuff\renpy\renpy-7.3.5-sdk\renpy\ast.py", line 1436, in execute
    rv = renpy.game.context().call(label, return_site=self.next.name)
  File "game/script.rpy", line 37, in script call
    call phone_start
  File "C:\Users\Jareth\Desktop\program stuff\renpy\renpy-7.3.5-sdk\renpy\script.py", line 898, in lookup
    raise ScriptError("could not find label '%s'." % str(original))
ScriptError: could not find label 'phone_start'.

Windows-8-6.2.9200
Ren'Py 7.3.5.606

You need to move the code to your own game script/screen/options scripts accordingly. Copy and paste the phone code from each of hers to yours.

would it be okay to use this for a commercial project with credits? thank you so much for making this nonetheless!

yea thats cool tho i think with the license stuff it would mean you would have to replace the art assets tho? i think

oh that sounds fair, tysm!!

Thank you, now I can continue to finish my project (for personal use only)

I've wanted to implent something like this in one of my VNs for so long! Thank you so much for posting this, that makes it so much easier!

yay

(1 edit)

I was playing around with the code and i wanted to send as the MC a picture. Is there a way to "reply" with an image being the MC?

The best i could do is put the call in the script.rpy as:

call message("nadia", "Why you don't send me a picture?")

call reply_message_img("me", "what do you think?","graphics/pic1.png")

and put the label in the options.rpy as follows:

label reply_message_img(who, what,img):
    $ renpy.pause()
    hide screen phone_message
    hide screen phone_message2
    hide screen phone_message3
    hide screen phone_message_image
    $ renpy.pause(0.1)
    show screen phone_message_image(who, what,img)
    return

But playing the game the message of the MC still looks as a message of nadia, I know i have to do something in the screen panel but i'm out of ideas.

Thanks for sharing the code, btw :) 


Deleted 3 years ago

This is beyond cool!

Thanks for sharing :)

Just played around with it for a few hours. Thanks so much for sharing. I wish I would have looked for this when I was doing nanoreno 2018 lol

Useful code. Great comments. Very helpful! Thanks :)

Loved! Thanks! I was looking for this!

Cute design. I like it. I tried to run your original file and find out that it fit my small screen. But when I copy your marked phone code to my project, it has bigger phone size. How to fix this? I'm still new at Ren'py.

if youre changing the  size you have to edit the image file for the phone to either make it  bigger or smaller to suit what you need. and change the numbers in the code to match the new size

I don't understand with the screen properties so I changed my whole project resolution to 1920*1080 lol and it's works fine with yours. Thank you. Your project really helpful for my school project.

Nadia, thanks for this and if you don't mind, can you tell me what I must change, I just need the name and then I'll solve it by my self.

Aaaahhh, thanks so much for posting this!!

i don't really understand how to do it. can u explain?

can you be more specific? 

hi!! i downloaded this and i'm really looking forward to using it, but it gives me an error when i try to run it :(

[code]
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screens.rpy", line 276, in script
    init python:
  File "game/screens.rpy", line 277, in <module>
    config.character_id_prefixes.append('namebox')
Exception: config.character_id_prefixes is not a known configuration variable.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/screens.rpy", line 276, in script
    init python:
  File "G:\software\game development\renpy-6.99.11-sdk\renpy\ast.py", line 805, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "G:\software\game development\renpy-6.99.11-sdk\renpy\python.py", line 1641, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/screens.rpy", line 277, in <module>
    config.character_id_prefixes.append('namebox')
  File "G:\software\game development\renpy-6.99.11-sdk\renpy\defaultstore.py", line 80, in __getattr__
    raise Exception('config.%s is not a known configuration variable.' % (name))
Exception: config.character_id_prefixes is not a known configuration variable.

Windows-8-6.2.9200
Ren'Py 6.99.11.1749
 
[/code]

i havent ran into an error like that before. are you directly running the game template you download with no modifications? cause if not try that first. also make sure your renpy is up to date. i dont know how to offer advice out of this though, sorry!

(+1)

this is pretty neat!!!! thanks for posting this

thanks! im happy to hear you like it