| Class SCA_DelaySensor (2.48) |
|
|
| getDelay |
setDelay |
| getDuration |
setDuration |
| getRepeat |
setRepeat |
|
|
|
| getFrequency |
reset |
| getInvert |
setFrequency |
| getLevel |
setInvert |
| getUseNegPulseMode |
setLevel |
| getUsePosPulseMode |
setUseNegPulseMode |
| isPositive |
setUsePosPulseMode |
| isTriggered |
---------- |
|
|
|
| getExecutePriority |
setExecutePriority |
| getOwner |
---------- |
|
|
getDelay
getDelay()
Returns the number of frames the sensor waits before using a positive
pulse to trigger the sensor.
Return Type: integer
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named sensor
sen = controller.getSensor("sensor")
# get the delay
delay = sen.getDelay()
getDuration
getDuration()
Returns the number of
frames the sensor waits after using a positive pulse to trigger the
sensor before it uses a negative pulse to deactive the sensor.
Return type: integer
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named sensor
sen = controller.getSensor("sensor")
# get the duration
dur = sen.getDuration()
getRepeat
getRepeat()
Returns the state of the Repeat (REP) toggle button.
Return Type: integer
1 = repeat the cycle (delay/duration) over and over.
0 = run cycle once. Don't repeat.
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named sensor
sen = controller.getSensor("sensor")
# repeat the delay/duration cycle?
cycle = sen.getRepeat()
setDelay
setDelay(delay)
Sets the number of frames the sensor waits before using a positive
pulse to trigger the sensor.
delay:
Type:
integer
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named sensor
sen = controller.getSensor("sensor")
# set the delay to 10 frames
sen.getDelay(10)
setDuration
setDuration(duration)
Sets the number of
frames the sensor waits after using a positive pulse to trigger the
sensor before it uses a negative pulse to deactive the sensor.
duration:
Type:
integer
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named sensor
sen = controller.getSensor("sensor")
# wait 20 frames before deactivating the sensor
sen.setDuration(20)
setRepeat
setRepeat(repeat)
Sets the state of the Repeat (REP) toggle button.
repeat:
Type:
integer
1 = repeat the cycle (delay/duration) over and over.
0 = run cycle once. Don't repeat.
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get the delay sensor attached to the controller named sensor
sen = controller.getSensor("sensor")
# repeat the delay/duration cycle
sen.setRepeat(1)
|