Aller au contenu


Photo

PS4Mono pour utiliser la Dual Shock 4 dans Monogame


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

Posté 27 mars 2017 - 08:54

#1
tralala

tralala

    \0/ Postman \0/

  • Newser Expert
  • 12 617 messages
  • Sexe:Male
Basé sur le language XNA développé par Microsoft pour la Xbox360, Monogame est une implémentation Open Source du framework Microsoft XNA 4.
 
Le but de cette implémentation est d'offrir la possibilité aux développeurs Xbox 360, Windows et Windows Phone, de porter leurs jeux sur iOS, Android, Mac OS X, Linux et Windows store. Totalement opensource, XNA a connu plus de 10 000 développeurs à sa belle époque.
 
 
 
 
 
 
 
Vous souhaitez développé un jeu, tentez l'expérience avec Monogame, une vidéo de présentation très intéressante est disponible ici.
 
 
 
 
 
 
 
 
 
Nombreux sont les tutoriels disponibles sur la toile pour s'essayer au développement d'un jeu sur Monogame, et bien sachez que si vous le souhaitez vous allez pouvoir utiliser votre Dual Shock 4 dans Monogame avec une librairie développée par Mystborn qui a libéré son code sur Github.
 


 
 
PS4Mono
 
Library for using PS4 Controllers in Monogame
 
To initialize the controllers, go to your game's initialize method and add this code:
 
PS4Mono.InputManager.Initialize(this)
 
Then in your game's update method go ahead and add this at the end:
 
PS4Mono.InputManager.Update()
 
That's all it needs to be set up. To actually use the code, call one of the various GampadCheck functions.
 
bool down = PS4Mono.InputManager.GamepadCheck(0, Buttons.A);
 
bool justPressed = PS4Mono.InputManager.GamepadCheckPressed(0, Buttons.A);
 
There's a special version of this that doesn't work on a frame by frame basis, so if you want to only check the buttons being pressed at the exact moment of time of the function call use:
 
PS4Mono.InputManager.GamepadCheckAsync(0, Buttons.A);
 
To set the deadzone used to check if the joystick is being held in a specific direction, you can set this property to a value between 0 and 1.
 
PS4Mono.InputManager.GamepadAxisDeadZone = value;
 
The prgram only looks for new controllers every 2 seconds, so dont expect your game to react to new input immediately. You can change this in the source code inside the RawInputDeviceManager class if it's an issue. It's just an arbitrary number.
 
Big thanks to www.pinvoke.net and https://github.com/a...rough/aenetmail
 

 

 

 
Téléchargement : PS4Mono Dual Shock 4
 

  • Retour en haut

Posté 27 mars 2017 - 11:05

#2
smada

smada

    Sunriseur PRIVILEGE

  • Members
  • PipPipPipPipPip
  • 3 092 messages
  • Sexe:Male
  • Lieu:Afrique
  • Passions:Ma passion
Merci
  • Retour en haut

Posté 27 mars 2017 - 19:54

#3
Gagny-Tech

Gagny-Tech

    Sunriseur PRIVILEGE

  • Technicien
  • 5 858 messages
  • Sexe:Male
  • Lieu:Paris (île de france)
Merci

Installation Reset Glitch Hack, Xkey...sur l'île de France // Xbox slim NEUVE GLITCH en vente

Downgrade PS3 NOR/NAND, Cobra, 3K3Y!! // PS3 3.55, PS3 3K3Y,Cobra, SWAP DISC et autres en vente

ENVOI POSTAL POSSIBLE ! 

Mes annonces Technicien :  

Xbox PS3 Feedback

  • Retour en haut

Posté 27 mars 2017 - 21:29

#4
Luffy74

Luffy74

    Sunriseur

  • Members
  • PipPip
  • 117 messages
  • Sexe:Male
  • Passions:Hacking & tuning PS3/WII/GC/PSP/DS...
merci bien!
  • Retour en haut




1 utilisateur(s) li(sen)t ce sujet

0 invité(s) et 1 utilisateur(s) anonyme(s)