public VirtualButtonMultiplexer(VirtualButton btn, VirtualStick stick = default(VirtualStick), bool isYAxis = false, bool isNegative = false) { _btn = btn; _stick = stick; _isYAxis = isYAxis; _isNegative = isNegative; }
public CameraAngleCalculator3D(GameObject faceObject, GameObject bodyObject, VirtualStick virtualStickR) { this.face = faceObject; this.body = bodyObject; //this.stick = stickIntegrator; this.stickR = virtualStickR; Sensitivity = Vector2.one * 3f; }
// Use this for initialization void Start() { this.head = this.FindGameObject(this.gameObject, "Head"); this.playerCamera = this.FindGameObject(this.head, "Main Camera"); this.groundChecker = this.FindGameObject(this.gameObject, "GroundChecker"); this.leftStick = this.transform.Find("LeftStick").GetComponent <VirtualStick>(); this.rightStick = this.transform.Find("RightStick").GetComponent <VirtualStick>(); this.isJumpReady = false; }
public void LoadContent() { _cursorSprite = new Sprite(Bloodbender.ptr.Content.Load <Texture2D>("cursor")); #if WINDOWS_PHONE // virtual stick content _phoneStick = new VirtualStick(_manager.Content.Load <Texture2D>("Common/socket"), _manager.Content.Load <Texture2D>("Common/stick"), new Vector2(80f, 400f)); Texture2D temp = _manager.Content.Load <Texture2D>("Common/buttons"); _phoneA = new VirtualButton(temp, new Vector2(695f, 380f), new Rectangle(0, 0, 40, 40), new Rectangle(0, 40, 40, 40)); _phoneB = new VirtualButton(temp, new Vector2(745f, 360f), new Rectangle(40, 0, 40, 40), new Rectangle(40, 40, 40, 40)); #endif _viewport = Bloodbender.ptr.GraphicsDevice.Viewport; }
public Player() { InputMove = new VirtualStick(App.Input) .Add(Keys.Left, Keys.Right, Keys.Up, Keys.Down) // Keyboard Arrow Keys .Add(0, Buttons.Left, Buttons.Right, Buttons.Up, Buttons.Down) // Controller DPad .Add(0, Axes.LeftX, Axes.LeftY, 0.2f); // Controller Left Stick InputJump = new VirtualButton(App.Input, 0.15f) .Add(Keys.X) // Keyboard X .Add(0, Buttons.A); // Controller A Button InputAttack = new VirtualButton(App.Input, 0.15f) .Add(Keys.C) // Keyboard C .Add(0, Buttons.X); // Controller X Button }
public void LoadContent() { _cursorSprite = _manager.EngineContentManager.Load <Texture2D>("Textures/Cursor"); _cursorSpriteClicked = _manager.EngineContentManager.Load <Texture2D>("Textures/Cursor"); #if WINDOWS_PHONE // virtual stick content _phoneStick = new VirtualStick(_manager.Content.Load <Texture2D>("Common/socket"), _manager.Content.Load <Texture2D>("Common/stick"), new Vector2(80f, 400f)); Texture2D temp = _manager.Content.Load <Texture2D>("Common/buttons"); _phoneA = new VirtualButton(temp, new Vector2(695f, 380f), new Rectangle(0, 0, 40, 40), new Rectangle(0, 40, 40, 40)); _phoneB = new VirtualButton(temp, new Vector2(745f, 360f), new Rectangle(40, 0, 40, 40), new Rectangle(40, 40, 40, 40)); #endif _viewport = _manager.GraphicsDevice.Viewport; TouchPanel.EnabledGestures = GestureType.Tap; PreviousScrollWheel = MouseState.ScrollWheelValue; }
public void LoadContent() { // _cursorSprite = new Sprite(_manager.Content.Load<Texture2D>("Common/cursor")); #if WINDOWS_PHONE // virtual stick content _phoneStick = new VirtualStick(_manager.Content.Load<Texture2D>("Common/socket"), _manager.Content.Load<Texture2D>("Common/stick"), new Vector2(80f, 400f)); Texture2D temp = _manager.Content.Load<Texture2D>("Common/buttons"); _phoneA = new VirtualButton(temp, new Vector2(695f, 380f), new Rectangle(0, 0, 40, 40), new Rectangle(0, 40, 40, 40)); _phoneB = new VirtualButton(temp, new Vector2(745f, 360f), new Rectangle(40, 0, 40, 40), new Rectangle(40, 40, 40, 40)); #endif _viewport = _manager.GraphicsDevice.Viewport; }
public WalkCalculator3D(GameObject walker, VirtualStick virtualStickL) { walkerObject = walker; this.stickL = virtualStickL; }