public PlayerInput(Stage stage, PlayerShip Ego, DisplayObject Owner) { #region Ego Movement // ego input stage.click += e => { if (!Enabled) return; var p = Owner.globalToLocal(e.ToStagePoint()); if (SmartMoveTo != null) SmartMoveTo(p.x, p.y); }; stage.mouseMove += e => { if (!Enabled) return; if (e.buttonDown) { var p = Owner.globalToLocal(e.ToStagePoint()); if (SmartMoveTo != null) SmartMoveTo(p.x, p.y); } }; var GoLeft = new KeyboardButton(stage) { Groups = new[] { MovementWASD[Keyboard.A], MovementArrows[Keyboard.LEFT], }, Filter = Enabled, Tick = () => this.StepLeft(), Up = () => this.StepLeftEnd() }; var GoRight = new KeyboardButton(stage) { Groups = new[] { MovementWASD[Keyboard.D], MovementArrows[Keyboard.RIGHT], }, Filter = Enabled, Tick = () => this.StepRight(), Up = () => this.StepRightEnd() }; #endregion #region EgoFire var DoFire = new KeyboardButton(stage, 700) { Groups = new[] { MovementWASD[Keyboard.CONTROL , KeyLocation.LEFT], MovementArrows[Keyboard.RIGHT , KeyLocation.RIGHT], MovementArrows[Keyboard.SPACE], }, Filter = Enabled, Tick = () => FireBullet() }; stage.mouseDown += delegate { if (!Enabled) return; DoFire.ForceKeyDown(); }; stage.mouseUp += delegate { if (!Enabled) return; DoFire.ForceKeyUp(); }; #endregion }
// X:\jsc.svn\examples\actionscript\test\TestResolveNativeImplementationExtension\TestResolveNativeImplementationExtension\Class1.cs public static DisplayObjectTasks get_async(DisplayObject that) { //Console.WriteLine("InteractiveObject get_async"); return new DisplayObjectTasks { that_DisplayObject = that }; }
/// <summary> /// Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself. /// </summary> public bool contains(DisplayObject child) { return default(bool); }
/// <summary> /// Returns the index position of a child DisplayObject instance. /// </summary> public int getChildIndex(DisplayObject child) { return default(int); }
/// <summary> /// Adds a child DisplayObject instance to this DisplayObjectContainer instance. /// </summary> public DisplayObject addChild(DisplayObject child) { return default(DisplayObject); }
/// <summary> /// Adds a child DisplayObject instance to this DisplayObjectContainer instance. /// </summary> public DisplayObject addChildAt(DisplayObject child, int index) { return default(DisplayObject); }
/// <summary> /// Changes the position of an existing child in the display object container. /// </summary> public void setChildIndex(DisplayObject child, int index) { }
public static void remove_addedToStage(DisplayObject that, Action<Event> value) { CommonExtensions.RemoveDelegate(that, value, Event.ADDED_TO_STAGE); }
public static void remove_render(DisplayObject that, Action<Event> value) { CommonExtensions.RemoveDelegate(that, value, Event.RENDER); }
/// <summary> /// Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. /// </summary> public DisplayObject removeChild(DisplayObject child) { return default(DisplayObject); }
public static void remove_removedFromStage(DisplayObject that, Action<Event> value) { CommonExtensions.RemoveDelegate(that, value, Event.REMOVED_FROM_STAGE); }
public static void add_removed(DisplayObject that, Action<Event> value) { CommonExtensions.CombineDelegate(that, value, Event.REMOVED); }
public static void remove_enterFrame(DisplayObject that, Action<Event> value) { CommonExtensions.RemoveDelegate(that, value, Event.ENTER_FRAME); }
/// <summary> /// Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes. /// </summary> public Rectangle getRect(DisplayObject targetCoordinateSpace) { return default(Rectangle); }
/// <summary> /// Swaps the z-order (front-to-back order) of the two specified child objects. /// </summary> public void swapChildren(DisplayObject child1, DisplayObject child2) { }
/// <summary> /// Evaluates the display object to see if it overlaps or intersects with the obj display object. /// </summary> public bool hitTestObject(DisplayObject obj) { return default(bool); }
public void Add(DisplayObject e) { e.AttachTo(this); }