Difference between revisions of "IC Python API:RLPy RPyTimerCallback"

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Inheritance== This class inherits public member functions from: *RLPy.RCallback =...")
 
m
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
==Inheritance==
+
{{last_modified}}
This class inherits public member functions from:
+
*[[IC_Python_API:RLPy_RCallback|RLPy.RCallback]]
+
==Detailed Description==
+
This class is used to register callbacks for timer event.
+
<syntaxhighlight lang="Python">
+
class MyPyTimerCallback(RLPy.RPyTimerCallback):
+
  def __init__(self):
+
   RLPy.RPyTimerCallback.__init__(self)
+
  
def Timeout(self):
+
== Description ==
   print ("timeout")
+
 
+
Used to register and recieve the status of the timer callback.
 +
 
 +
=== Inheritance ===
 +
 
 +
[[IC_Python_API:RLPy_RCallback|RCallback]]> [[IC_Python_API:RLPy_RPyTimerCallback|RPyTimerCallback]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
class MyPyTimerCallback(RLPy.RPyTimerCallback):
 +
  def __init__(self):
 +
      RLPy.RPyTimerCallback.__init__(self)
 +
  def Timeout(self):
 +
      print ("timeout")
 +
 
timer = RLPy.RPyTimer()
 
timer = RLPy.RPyTimer()
 
timer.SetInterval(100)
 
timer.SetInterval(100)
Line 22: Line 26:
 
timer.Start()
 
timer.Start()
 
</syntaxhighlight>
 
</syntaxhighlight>
-----
+
 
===Timeout===
+
See Also: [[IC_Python_API:RLPy_RPyTimer|RPyTimer]]
<syntaxhighlight lang="Python">
+
RLPy.RPyTimerCallback.Timeout ( self )
+
</syntaxhighlight>
+
This function is called when the timer times out.
+

Revision as of 03:29, 28 April 2020

Main article: Modules.
Last modified: 04/28/2020

Description

Used to register and recieve the status of the timer callback.

Inheritance

RCallback> RPyTimerCallback
 1 class MyPyTimerCallback(RLPy.RPyTimerCallback):
 2    def __init__(self):
 3        RLPy.RPyTimerCallback.__init__(self)
 4    def Timeout(self):
 5        print ("timeout")
 6  
 7 timer = RLPy.RPyTimer()
 8 timer.SetInterval(100)
 9 # register callback
10 timer_callback = MyPyTimerCallback()
11 timer.RegisterPyTimerCallback(timer_callback)
12 # start timer
13 timer.Start()

See Also: RPyTimer