   . Windows Phone
 


            ,     . ,   ,      .          .





   

Windows Phone



 



 ,2018



ISBN978-5-4493-6869-0

     Ridero







      㠖     , , , .         -.   ,             .

     5             ⠖ Android, IOS, Windows Phone.     Microsoft   ,        (  Visual Studio  )    ,        , ,          ,     .

        Microsoft   ,    .

Ӡ    - ,   C#.

       ,             ⠫ .      ,      (    Game).

     .. ..,     ,       .




  XNA





  


      Windows Phone      C#.     :

////////////////////////////////////////////////////////////////////////////

if (1) //    

{

// ,   ,  1 

}

elseif (2) // 

{

// ,   ,  1 ,  2

}

else// 

{

// ,   ,   12

}

////////////////////////////////////////////////////////////////////////////

switch (1)

{

case 2:

// ,   ,   12

break;

case 3:

// ,   ,   13

break;

<>

}

////////////////////////////////////////////////////////////////////////////

 [] mas1 = new  [ ]; //   

 [,] mas2 = new  [ ,  ]; //  

////////////////////////////////////////////////////////////////////////////

foreach ( _ inmas1) //   

{

//     mas1,     _

}

////////////////////////////////////////////////////////////////////////////

for (i= _; i<= _; i++) //

{

//  

}

////////////////////////////////////////////////////////////////////////////

While () //     =true

{

//  

}

////////////////////////////////////////////////////////////////////////////

Random rand = new Random (); //   rand    

//     0 :

_ = rand.Next (_);

//       :

_ = rand.Next (_, _);

////////////////////////////////////////////////////////////////////////////




  XNA


     Windows Phone,        XNA.     Silverlight,     ,        ,        ,      Windows Phone SDK   XNA.

      1.






 1     Windows Phone



     ,  ,    Game1.cs,      (.2).






 2  



Background.png  PhoneGameThump.png   ,    ,         .

  GameContent     : , ,   .                        "  " ( 3):






 3  



  Game1.cs      :

public Game1()

{

//    ,  ,

//    ,     

}

protected override void LoadContent()

{

//    ,   

}

protected override void Update(GameTime gameTime)

{

//   ,    

base.Update(gameTime);

}

protected override void Draw(GameTime gameTime)

{

//     

base.Draw(gameTime);

}




   XNA


      ,          *.spritefont,  *   ,     :



<?xml version="1.0" encoding="utf-8"?>

<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">

<Asset Type= " Graphics: FontDescription>

<FontName>Segoe UI</FontName>

<Size>15</Size>

<Spacing>0</Spacing>

<UseKerning>true</UseKerning>

<Style>Bold</Style>

<CharacterRegions>

<CharacterRegion>

<Start> </Start>

<End>~</End>

</CharacterRegion>

<CharacterRegion>

<Start></Start>

<End></End>

</CharacterRegion>

</CharacterRegions>

</Asset>

</XnaContent>



FontName       , Microsoft    -  ,      Segoe  .

Size    .

Style     (Regular, Bold, Italic).

CharacterRegion   ,   ,        ,     .

     ,     :

SpriteFont _; //      Game1

  LoadContent()  :

_ = Content.Load<SpriteFont>("*"); // *   

  Draw(GameTime gameTime)    :

spriteBatch.DrawString(_, ",   ", new Vector2(_x, _y), Color.);

    :

Texture2D _; //      Game1

  LoadContent()  :

_ = Content.Load<Texture2D>("*"); //  *   

  Draw(GameTime gameTime)  :

spriteBatch.Draw(_, new Rectangle(_x, _y, , ), Color.White);




 





 


              ,            .

  Game1()  ,      :

public Game1()

{

<>

TouchPanel.EnabledGestures = GestureType.Tap | GestureType.FreeDrag;

<>

}

     ,   " GestureType".    ,  Tap , FreeDrag , Hold  , DoubleTap  .       .

    :

while (TouchPanel.IsGestureAvailable)

{

//  

GestureSample gesture = TouchPanel.ReadGesture();

//      

int tapY = (int)gesture.Position.Y;

int tapX = (int)gesture.Position.X;

<>

switch (gesture.GestureType)

{

//    :

case GestureType.Tap:

<>

break;

<>

//    :

case GestureType.FreeDrag:

<>

break;

}

}




  


      ,          (,      ).

        ,          ,          (    ), :

      1   2

        ,       ,      ,       :

if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)




  .


   .

   ,     (https://www.litres.ru/ivan-treschev-174274/programmirovanie-dlya-mobilnyh-platform-windows-phone/)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


