当前位置: 首页 > news >正文

淘宝网首页官网登录焦作seo推广

淘宝网首页官网登录,焦作seo推广,营销型网站建设易网拓,江门网站建设维护在XNA中如果我们需要输入文字,那么我们就需要使用到软键盘了,在XNA中使用软键盘要用到Guide.BeginShowKeyboardInput方法,由于游戏的Update是会不断地执行的,所以要由Guide.IsVisible来检查弹出输入框是否已经显示出来了。Guide.B…

在XNA中如果我们需要输入文字,那么我们就需要使用到软键盘了,在XNA中使用软键盘要用到Guide.BeginShowKeyboardInput方法,由于游戏的Update是会不断地执行的,所以要由Guide.IsVisible来检查弹出输入框是否已经显示出来了。

Guide.BeginShowKeyboardInput方法的参数
PlayerIndex 玩家的编号,手机是PlayerIndex.One
Title 输入窗口的标题
Description 输入窗口的描述
DefaultText 默认的文字
Callback 回调的方法
State 使用者想要传送的物件

Guide.BeginShowMessageBox时弹出一个窗口没有软键盘输入,这个方法的参数分別是
Title 窗口的标题
Text 窗口的文字
Buttons 按钮
FoucsButton 预设的按钮
Icon 图标
Callback 回调的方法
State 使用者想要传送的物件

 

示例

 

 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using Microsoft.Xna.Framework;  
  5. using Microsoft.Xna.Framework.Audio;  
  6. using Microsoft.Xna.Framework.Content;  
  7. using Microsoft.Xna.Framework.GamerServices;  
  8. using Microsoft.Xna.Framework.Graphics;  
  9. using Microsoft.Xna.Framework.Input;  
  10. using Microsoft.Xna.Framework.Input.Touch;  
  11. using Microsoft.Xna.Framework.Media;  
  12.  
  13. namespace SIPSample  
  14. {  
  15.     /// <summary> 
  16.     /// This is the main type for your game  
  17.     /// </summary> 
  18.     public class Game1 : Microsoft.Xna.Framework.Game  
  19.     {  
  20.         GraphicsDeviceManager graphics;  
  21.         SpriteBatch spriteBatch;  
  22.  
  23.         SpriteFont spriteFont;  
  24.  
  25.         string sipTitle = "This is the title.";  
  26.         string sipDescription = "This is the description that goes beneath the title.";  
  27.         string sipResult = "You type stuff here.";  
  28.  
  29.         public Game1()  
  30.         {  
  31.             graphics = new GraphicsDeviceManager(this);  
  32.             Content.RootDirectory = "Content";  
  33.             TargetElapsedTime = TimeSpan.FromTicks(333333);  
  34.         }  
  35.  
  36.         protected override void Initialize()  
  37.         {  
  38.             base.Initialize();  
  39.         }  
  40.  
  41.         protected override void LoadContent()  
  42.         {  
  43.             spriteBatch = new SpriteBatch(GraphicsDevice);  
  44.             spriteFont = Content.Load<SpriteFont>("SpriteFont1");  
  45.         }  
  46.  
  47.         protected override void UnloadContent()  
  48.         {  
  49.         }  
  50.         /// <summary> 
  51.         /// 输入完成回调方法  
  52.         /// </summary> 
  53.         /// <param name="result"></param> 
  54.         void keyboardCallback(IAsyncResult result)  
  55.         {  
  56.             string retval = Guide.EndShowKeyboardInput(result);  
  57.  
  58.             if (retval != null)  
  59.             {  
  60.                 sipResult = retval;  
  61.             }  
  62.         }  
  63.  
  64.         protected override void Update(GameTime gameTime)  
  65.         {  
  66.             if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)  
  67.                 this.Exit();  
  68.             // Display the SIP  
  69.             TouchCollection touchCollection = TouchPanel.GetState();  
  70.  
  71.             foreach (TouchLocation touch in touchCollection)  
  72.             {  
  73.                 if (touch.State == TouchLocationState.Pressed)  
  74.                     if (!Guide.IsVisible)  
  75.                         //弹出软键盘输入框  
  76.                         Guide.BeginShowKeyboardInput(PlayerIndex.One, sipTitle, sipDescription,  
  77.                             sipResult, keyboardCallback, new object());  
  78.             }  
  79.  
  80.             base.Update(gameTime);  
  81.         }  
  82.  
  83.         protected override void Draw(GameTime gameTime)  
  84.         {  
  85.             GraphicsDevice.Clear(Color.CornflowerBlue);  
  86.  
  87.             //绘制界面的文字  
  88.             spriteBatch.Begin();  
  89.             spriteBatch.DrawString(spriteFont, sipResult, new Vector2 { X = 50Y = 200 }, Color.Black);  
  90.             spriteBatch.End();  
  91.  
  92.             base.Draw(gameTime);  
  93.         }  
  94.     }  

 

 

 

 


本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1078385

http://www.lbrq.cn/news/2569843.html

相关文章:

  • 那些网站可以接私活做seo网络推广企业
  • 免费个人简历制作网站怎么网络推广自己业务
  • 网页设计要多少钱电脑系统优化工具
  • 网站建设一条龙ue365企业文化标语
  • 肥西网站建设教育培训机构有哪些
  • 网站pv统计方法站长之家音效
  • 痘痘怎么去除效果好网站关键词优化排名外包
  • 移动端网站如何优化最新全国疫情消息
  • 政府门户网站升级建设方案广州 竞价托管
  • 网站上facebook怎么做链接seo网站外链工具
  • 和萝莉做的电影网站电商培训机构
  • 初学者做网站的软件百度移动端优化
  • 免费发布网页的网站软文写作技巧及范文
  • 广告网站定制app推广代理去哪里找
  • 西昌网站建设杭州百度整站优化服务
  • 有没有学校需要建设网站在线的crm系统软件
  • 美国主机教育网站建设手机端竞价恶意点击
  • web开发是做网站吗源码网
  • 文山建设局网站线上培训平台
  • 网站推广最有效的方法搜索风云榜百度
  • asp net网站开发语言的特点企业在线培训系统
  • 连云港企业建站 网站昆明seo技术培训
  • 登录名修改wordpress云南网站seo服务
  • 西安 网站建设广告联盟哪个比较好
  • b2c电子商务网站建设价格多少钱广州网络营销运营
  • php做网站要用到的技术cpc广告接单平台
  • 武汉网站制作哪家强友情链接的概念
  • 郑州高端网站制作武汉网络推广网络营销
  • 网站标题作弊详解龙岗seo网络推广
  • o2o网站开发公司搜狗指数
  • pytorch的 Size[3] 和 Size[3,1] 区别
  • Linux 高级 I/O 系统调用详解
  • 大模型结构比较
  • 预测性维护之温振传感器选型与应用秘籍
  • 理解HTTP协议
  • 技术信任革命:区块链重构信用机制全解析