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 6:37 pm

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  [ 5 posts ] 
Author Message
PostPosted: Sun May 27, 2012 12:25 am 
Regular
User avatar

Joined: Wed Apr 25, 2012 7:25 am
Posts: 26
Location: Korea, Republic of.
Projects: Lance of Longinus, Charm Harmony, Aristata, Cage Bakery, 4Leaf
I want to control the vibration config option using the button

Code:
label _("진동 제어")
                hbox:
                    xalign 1.0
                    textbutton _("On") action ('vibrate', 'True')
                    textbutton _("Off") action ('vibrate', 'False')


But it's so bad...
How to change code??


Top
 Profile Send private message  
 
PostPosted: Sun May 27, 2012 1:06 am 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10771
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
Code:
init python:
     if persistent.vibrate is None:
         persistent.vibrate = True

     def vibrate(duration):
          if persistent.vibrate:
               renpy.vibrate(duration)

...

                label _("진동 제어")
                hbox:
                    xalign 1.0
                    textbutton _("On") action SetField(persistent, 'vibrate', True)
                    textbutton _("Off") action SetField(persistent, 'vibrate', False)

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
PostPosted: Mon May 28, 2012 1:22 am 
Regular
User avatar

Joined: Wed Apr 25, 2012 7:25 am
Posts: 26
Location: Korea, Republic of.
Projects: Lance of Longinus, Charm Harmony, Aristata, Cage Bakery, 4Leaf
PyTom~! I'm Failed...
nothing event Off Button...


this is less details in the label
Code:
$ renpy.vibrate(1.0)


this is less details in the screen
Code:
screen preferences:
       
        frame:
            style_group "pref"
           
            has vbox:
                label _("문자 속도")
                bar value Preference("text speed")

                label _("배경음 음량")
                bar value Preference("music volume")

                label _("효과음 음량")
                bar value Preference("sound volume")

                if config.sample_sound:
                    textbutton "테스트":
                        action Play("sound", config.sample_sound)
                        style "soundtest_button"
               
                label _("진동 제어")
                hbox:
                    xalign 1.0
                    textbutton _("진동켜기") action SetField(persistent, 'vibrate', True)
                    textbutton _("진동끄기") action SetField(persistent, 'vibrate', False)


this is less details in the init python
Code:
if persistent.vibrate is None:
        persistent.vibrate = True

    def vibrate(duration):
        if persistent.vibrate:
            renpy.vibrate(duration)


Top
 Profile Send private message  
 
PostPosted: Mon May 28, 2012 9:26 am 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10771
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
I don't know what you're trying to say.

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
PostPosted: Tue May 29, 2012 7:53 pm 
Regular
User avatar

Joined: Wed Apr 25, 2012 7:25 am
Posts: 26
Location: Korea, Republic of.
Projects: Lance of Longinus, Charm Harmony, Aristata, Cage Bakery, 4Leaf
PyTom wrote:
I don't know what you're trying to say.


Oh ... I understand what your say. Thank you very much,
Ren'Py is wonderful gift for me.

Sorry for my bad english.


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Donmai


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