Exemplo n.º 1
0
 public TranslatedProbe(Point Offset, Probe Source)
     : base(Source)
 {
     this._Offset = Offset;
 }
Exemplo n.º 2
0
 public InputContext(Probe Probe)
 {
     this._Probe = Probe;
 }
Exemplo n.º 3
0
 public DerivedProbe(Probe Source)
 {
     this._Source = Source;
 }
Exemplo n.º 4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.MakeCurrent();

            this._Renderer = new Renderer();
            this._Renderer.Cache = new FileSystemRenderCache(Program.Cache["Render"]);
            this._Renderer.Initialize();
            SystemTypeface.Create = this._Renderer.CreateSystemTypeface;

            this._Probe = new Probe();
            this._InputContext = new InputContext(this._Probe);

            this._Camera = new Camera(new Point(0.0, 0.0), 1.0);
            this._Ambience = new OceanAmbience(Random.Default);
            this._World = new World(this._InputContext, new Theme());
            this._MakeView();

            Content testcontent = new EditorContent();
            this._World.Spawn(testcontent, Point.Origin);
        }
Exemplo n.º 5
0
Arquivo: Node.cs Projeto: dzamkov/DUIP
 public _NodeProbe(Node Node, Probe Source)
     : base(Source)
 {
     this._Node = Node;
 }
Exemplo n.º 6
0
Arquivo: Node.cs Projeto: dzamkov/DUIP
 /// <summary>
 /// Calls the probe signal change handler on the input context and returns wether the event was handled.
 /// </summary>
 /// <param name="Probe">The probe in the parent input context whose signal was changed.</param>
 public bool ProbeSignalChange(Probe Probe, ProbeSignal Signal, bool Value)
 {
     bool handled = false;
     if (this._ProbeSignalChange != null)
     {
         this._ProbeSignalChange(new _NodeProbe(this._Node, Probe), Signal, Value, ref handled);
     }
     return handled;
 }
Exemplo n.º 7
0
Arquivo: Node.cs Projeto: dzamkov/DUIP
        /// <summary>
        /// Handles a probe signal change over the node.
        /// </summary>
        /// <param name="Offset">The offset of the probe from the top-left corner of the node.</param>
        public void ProbeSignalChange(World World, Probe Probe, Point Offset, ProbeSignal Signal, bool Value)
        {
            // See if the event can be handled by the content of the node
            if (this._InputContext.ProbeSignalChange(Probe, Signal, Value))
                return;

            // Start dragging if possible
            if (this._DragState == null && Signal == ProbeSignal.Primary && Value == true)
            {
                this._DragState = new DragState
                {
                    Offset = Offset,
                    Probe = Probe,
                    ReleaseProbe = Probe.Lock()
                };
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Handles a probe signal change event from the input context.
 /// </summary>
 private void _ProbeSignalChange(Probe Probe, ProbeSignal Signal, bool Value, ref bool Handled)
 {
     Point pos = Probe.Position;
     Node node = this.NodeAtPoint(pos);
     if (node != null)
     {
         Handled = true;
         node.ProbeSignalChange(this, Probe, pos - node.Position, Signal, Value);
     }
 }