Name Image Side on mobile

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
Appryl
Newbie
Posts: 6
Joined: Mon Oct 10, 2016 2:38 pm
Contact:

Name Image Side on mobile

#1 Post by Appryl » Tue Oct 11, 2016 11:28 am

EDIT: Thanks to Ocelot for my first "bug" o/ But I have another one...

Hi everyone !
For my character's name I use an Image Side, it works well on the computer version, but on the iOS or Android version the name/image just doesn't appears o:
I checked the options, gui, screen, nothing's strange for the mobile options, I don't understand... Everything works and is the same in the game, just the name/image is not here.
What should I do ?
Last edited by Appryl on Tue Oct 11, 2016 4:06 pm, edited 3 times in total.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Two textbars day/night

#2 Post by Ocelot » Tue Oct 11, 2016 11:33 am

ConditionSwitch might be what you are looking for: https://www.renpy.org/doc/html/displaya ... tionSwitch
< < insert Rick Cook quote here > >

Appryl
Newbie
Posts: 6
Joined: Mon Oct 10, 2016 2:38 pm
Contact:

Re: Two textbars day/night

#3 Post by Appryl » Tue Oct 11, 2016 11:42 am

Hmm, I have this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 66, in script
    image textbar = ConditionSwitch(
  File "game/script.rpy", line 68, in <module>
    "True", "gui/textbox.png")
SyntaxError: invalid syntax (<none>, line 1)

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

Full traceback:
  File "game/script.rpy", line 66, in script
    image textbar = ConditionSwitch(
  File "C:\Users\Maxime\Desktop\renpy-6.99.11-sdk\renpy\ast.py", line 896, in execute
    img = renpy.python.py_eval_bytecode(self.code.bytecode)
  File "C:\Users\Maxime\Desktop\renpy-6.99.11-sdk\renpy\python.py", line 1665, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/script.rpy", line 68, in <module>
    "True", "gui/textbox.png")
  File "C:\Users\Maxime\Desktop\renpy-6.99.11-sdk\renpy\display\layout.py", line 1276, in ConditionSwitch
    code = renpy.python.py_compile(cond, 'eval')
  File "C:\Users\Maxime\Desktop\renpy-6.99.11-sdk\renpy\python.py", line 534, in py_compile
    raise e
SyntaxError: invalid syntax (<none>, line 1)

Windows-8-6.2.9200
Ren'Py 6.99.11.1749
Danganronpa/Zero 0.3

And in my script :

Code: Select all

image textbar = ConditionSwitch(
    "day_night = 1", "textboxnight.png",
    "True", "textbox.png")

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Two textbars day/night

#4 Post by Ocelot » Tue Oct 11, 2016 11:46 am

day_night == 1, not day_night = 1
< < insert Rick Cook quote here > >

Appryl
Newbie
Posts: 6
Joined: Mon Oct 10, 2016 2:38 pm
Contact:

Re: Two textbars day/night

#5 Post by Appryl » Tue Oct 11, 2016 11:52 am

EDIT: Thanks to Ocelot for my first "bug" o/ But I have another one...

Hi everyone !
For my character's name I use an Image Side, it works well on the computer version, but on the iOS or Android version the name/image just doesn't appears o:
I checked the options, gui, screen, nothing's strange for the mobile options, I don't understand... Everything works and is the same in the game, just the name/image is not here.
What should I do ?

User avatar
ChibbiNation
Newbie
Posts: 9
Joined: Sat Nov 19, 2016 11:29 pm
Tumblr: ChibbiNation
Deviantart: ChibbiNation
Location: New York, NY
Contact:

Re: Name Image Side on mobile

#6 Post by ChibbiNation » Tue Nov 22, 2016 8:38 pm

No solution for this? I'm also interested as to why side images don't show on mobile phones... I think I could make it work without them, but it would really take away from the experience for mobile users..

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Name Image Side on mobile

#7 Post by philat » Tue Nov 22, 2016 8:47 pm

...well, because by default side images are hidden on small screens? It's explained and commented in screens.rpy. If you don't like it, of course you can change it.

User avatar
ChibbiNation
Newbie
Posts: 9
Joined: Sat Nov 19, 2016 11:29 pm
Tumblr: ChibbiNation
Deviantart: ChibbiNation
Location: New York, NY
Contact:

Re: Name Image Side on mobile

#8 Post by ChibbiNation » Tue Nov 22, 2016 9:19 pm

Ah, so THAT'S what this meant:

Code: Select all

 
# If there's a side image, display it above the text. Do not display
    # on the phone variant - there's no room.
    #if not renpy.variant("small"):
        add SideImage() xalign 0.015 yalign 0.995
I wasn't sure what the "phone variant" was, i thought maybe it was some way to use a phone inside the game, hahaha! Well, I hashtagged it and now the side images show perfectly on the mobile versions.. but sure, the text padding and namebox are a bit messed up, but I think it's workable... you'd just need to do the distributions for the desktop versions first, then adjust adjust options and screens.rpy for the mobile versions.. it's extra work, but certainly doable.

Thanks for the tip, it was really useful!

Post Reply

Who is online

Users browsing this forum: No registered users