摘要: XNA不支持GIF动画,PNG也需要以平铺的形式 还是郡主: 在我已经有了一些GIF资源的时候,如果能有一个工具可以将GIF转为平铺的PNG就好了 求人不如求已,自己写了一个 1: using System; 2: using System.Collections.Generic; 3: using System.Drawing; 4: using System.Drawing.Imaging; 5: using System.IO; 6: using System.Linq; 7: usin... 阅读全文
posted @ 2012-01-03 17:50 tiny羊 阅读(500) 评论(0) 推荐(0)
摘要: 首先,我为动画精灵创建一个类 1: public class AnimatedSprite 2: { 3: Point _frameSize; 4: int _currentFrame; 5: private readonly int _frame = 4; 6: private readonly Texture2D _sprite; 7: public AnimatedSprite(Texture2D texture, int fra... 阅读全文
posted @ 2011-12-30 21:45 tiny羊 阅读(391) 评论(0) 推荐(0)
摘要: 在XNA中,可以通过GraphicsDeviceManager提供的ToggleFullScreen来进行全屏状态转换 通常的游戏中,都会使用Alt+Enter来进行全屏状态切换,所以我们可以在Update中使用如下代码进行全屏切换 1: protected override void Update(GameTime gameTime) 2: 3: { 4: 5: if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pre... 阅读全文
posted @ 2011-12-27 21:57 tiny羊 阅读(301) 评论(0) 推荐(0)
摘要: base 访问基类的成员。 this 引用类的当前实例。   get   为属性或索引器定义访问器方法。 partial 在整个同一编译单元内定义分部类、结构和接口。 set   为属性或索引器定义访问器方法。 where 向泛型声明中添加约束。 yield 在迭代器块中使用,用于向枚举数对象返回值或发信号结束迭代。 value 用于设置访问器和添... 阅读全文
posted @ 2008-10-06 21:02 tiny羊 阅读(269) 评论(0) 推荐(0)
摘要: explicit 关键字用于声明必须使用强制转换来调用的用户定义的类型转换运算符。例如,在下面的示例中,此运算符将名为 Fahrenheit 的类转换为名为 Celsius 的类: public static explicit operator Celsius(Farenheit f){//我这么定义 return new Celsius((5.0f/9.0f)*(f.degrees-32));}... 阅读全文
posted @ 2008-10-06 21:00 tiny羊 阅读(383) 评论(0) 推荐(0)
摘要: as   将对象转换为可兼容类型。 is   检查对象的运行时类型。 new new 运算符   创建对象。 new 修饰符   隐藏继承成员。 new 约束   限定类型参数。 sizeof   获取类型的大小。 typeof   获取类型的 System.... 阅读全文
posted @ 2008-10-06 20:53 tiny羊 阅读(256) 评论(0) 推荐(0)
摘要: params 参数public static void UseParams2(params object[] list) {//...}static void Main(){UseParams2(1, 'a', "test");}ref 传引用//chhlgy 逸之羊static void Method(ref int i){i = 44;}static void Main() {int val ... 阅读全文
posted @ 2008-10-06 20:50 tiny羊 阅读(177) 评论(0) 推荐(0)
摘要: 选择语句 if(x==1){//语句1} else{//语句2}switch(x){case 1: //语句1break;//必写case 2://语句2break;default://其它//语句3break;}迭代语句 for(int i=0;i<100;i++){//...}foreach(int i in x){//...use i}int x = 0;do{x++;//先执行后判... 阅读全文
posted @ 2008-10-06 20:43 tiny羊 阅读(318) 评论(0) 推荐(0)
摘要: 访问修饰符 public  private 只有类内能访问  internal 同命名空间可访问 protected 继承类可访问 哪些不能修饰类或结构体 protected/private/protected internal abstract 指示某个类只能是其他类的基类,就它限制的类是不能实例化的 const 指定无法修改字段或局部变量的值,常量,编译时赋值。 event... 阅读全文
posted @ 2008-10-06 20:09 tiny羊 阅读(270) 评论(0) 推荐(0)
摘要: 前题条件 (user)用户表 id,un,pwd,regtime 类型 bigint,nvarchar(50),varchar(32),smalldatetime 1.bigint相当于.net中什么数据类型:long  类似问题对应 基本对应关系 sqlserver类型:C#类型 .net类型 bigint:long Int64 int:int Int32 smallint:short... 阅读全文
posted @ 2008-10-05 23:36 tiny羊 阅读(472) 评论(0) 推荐(0)