public BallThrowBullet(IWorld mundo, GraphicFactory factory)
        {            
            this.factory = factory;
            _mundo = mundo;            
            {
                ///Register a function to be called when the the mouse is pressed
                InputPlaybleMouseBottom ip1 = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.IOBJECT, MouseButtons.LeftButton, mousebuttonteste);
                mm0 = new BindMouseCommand(ip1, BindAction.ADD);
                CommandProcessor.getCommandProcessor().SendCommandAssyncronous(mm0);
            }            

        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Picking"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="pickingRayDistance">The picking ray distance.</param>
        public Picking(IScene owner, float pickingRayDistance = 500)
            : base(owner)
        {            
            leftButtonIntercept = rightButtonIntercept = noneButtonIntercept = CullNothing;
            this.pickingRayDistance = pickingRayDistance;
            world = owner.World;
            info = owner.GraphicInfo;

            {
                SimpleConcreteMouseBottomInputPlayable pbLeft = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.COMPONENT, MouseButtons.LeftButton, MouseBottomLeft, InputMask.GPICKING);
                bmc1 = new BindMouseCommand(pbLeft, BindAction.ADD);
                CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bmc1);
            }

            {
                SimpleConcreteMouseBottomInputPlayable pbRight = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.COMPONENT, MouseButtons.RightButton, MouseBottomRight, InputMask.GPICKING);
                bmc2 = new BindMouseCommand(pbRight, BindAction.ADD);
                CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bmc2);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Binds the MousePosition input.
 /// </summary>
 /// <param name="ipk">The InputPlaybleMousePosition.</param>
 public void BindInput(InputPlaybleMousePosition ipk)
 {
     System.Diagnostics.Debug.Assert(ipk != null);
     BindMouseCommand bkc = new BindMouseCommand(ipk, BindAction.ADD);
     MouseBinds.Add(ipk, bkc);
     CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bkc);
 }