DirectOutputR1
DirectOutput framework R1 for virtual pinball cabinets.
Go to:
Overview 
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
AnalogToyOnOffEffect.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using DirectOutput.Cab.Toys.Layer;
6 
7 namespace DirectOutput.FX.AnalogToyFX
8 {
13  {
14  private AnalogAlphaValue _ActiveValue = new AnalogAlphaValue(255,255);
15 
22  public AnalogAlphaValue ActiveValue
23  {
24  get { return _ActiveValue; }
25  set { _ActiveValue = value; }
26  }
27 
28  private AnalogAlphaValue _InactiveValue = new AnalogAlphaValue(0, 0);
29 
36  public AnalogAlphaValue InactiveValue
37  {
38  get { return _InactiveValue; }
39  set { _InactiveValue = value; }
40  }
41 
48  public override void Trigger(Table.TableElementData TableElementData)
49  {
50 
51 
52  if (Toy != null)
53  {
54  if (TableElementData == null || TableElementData.Value != 0)
55  {
56  Toy.Layers[Layer].Set(ActiveValue);
57  }
58  else
59  {
60  Toy.Layers[Layer].Set( InactiveValue);
61  }
62  }
63  }
64 
69  public override void Init(Table.Table Table)
70  {
71  base.Init(Table);
72  }
73 
77  public override void Finish()
78  {
79  if (Toy != null)
80  {
81  Toy.Layers.Remove(Layer);
82  }
83  base.Finish();
84  }
85  }
86 }