• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SdlDotNet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SdlDotNet的典型用法代码示例。如果您正苦于以下问题:C# SdlDotNet类的具体用法?C# SdlDotNet怎么用?C# SdlDotNet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SdlDotNet类属于命名空间,在下文中一共展示了SdlDotNet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Draw

        public void Draw(SdlDotNet.Graphics.Surface video)
        {
            foreach (Hero h in GameObjects)
            {
                h.Draw(video);
            }

            foreach (Enemy v in Vijanden)
            {
                v.Draw(video);
            }
            foreach (Grass g in GrassObjects)
            {
                g.Draw(video);
            }
            foreach (LifeItem l in LifeObjects)
            {
                l.Draw(video);
            }
            foreach (MetalBlock m in MetalObjects)
            {
                m.Draw(video);
            }
            foreach (NextLevelDoor n in NextLevelObjects)
            {
                n.Draw(video);
            }
        }
开发者ID:LorenzPut,项目名称:Project-ICT-3,代码行数:28,代码来源:Level1.cs


示例2: TextSprite

 /// <summary>
 /// Creates a new TextSprite given the text, font, color and anti-aliasing flag.
 /// </summary>
 /// <param name="textItem">Text to display</param>
 /// <param name="font">The font to use when rendering.</param>
 /// <param name="color">Color of Text</param>
 /// <param name="antiAlias">A flag determining if it's to 
 /// use anti-aliasing when rendering. Defaults to true.</param>
 public TextSprite(
     string textItem,
     SdlDotNet.Graphics.Font font,
     Color color, bool antiAlias)
     : this(textItem, font, color, antiAlias, new Point(0, 0))
 {
 }
开发者ID:ywjno,项目名称:mynes-code,代码行数:15,代码来源:TextSprite.cs


示例3: TextSprite

 /// <summary>
 /// Creates a new TextSprite given the text, font and color.
 /// </summary>
 /// <param name="textItem">Text to display</param>
 /// <param name="font">The font to use when rendering.</param>
 /// <param name="color">color of Text</param>
 public TextSprite(
     string textItem,
     SdlDotNet.Graphics.Font font,
     Color color)
     : this(textItem, font, color, true)
 {
 }
开发者ID:Blizz9,项目名称:FanCut,代码行数:13,代码来源:TextSprite.cs


示例4: CombineImage

 /// <summary>
 /// Combines two surfaces together.
 /// </summary>
 /// <param name="bottomImage">The surface that will be used as the background.</param>
 /// <param name="topImage">The surface that will be used as the foreground.</param>
 /// <returns>The combined surface.</returns>
 public static SdlDotNet.Graphics.Surface CombineImage(SdlDotNet.Graphics.Surface bottomImage, SdlDotNet.Graphics.Surface topImage)
 {
     SdlDotNet.Graphics.Surface returnSurf = new SdlDotNet.Graphics.Surface(new System.Drawing.Size(System.Math.Max(bottomImage.Width, topImage.Width), System.Math.Max(bottomImage.Height, topImage.Height)));
     returnSurf.Blit(bottomImage, new System.Drawing.Point(0, 0));
     returnSurf.Blit(topImage, new System.Drawing.Point(0, 0));
     return returnSurf;
 }
开发者ID:blastboy,项目名称:Client,代码行数:13,代码来源:Tools.cs


示例5: onKeyboard

        // this procedure is called when a key is pressed or released
        static void onKeyboard(object sender, SdlDotNet.Input.KeyboardEventArgs args) {

            if (args.Down) { 

                switch (args.Key) {
                    case SdlDotNet.Input.Key.W:
                        ship.forward = !ship.forward;
                        break;
                    case SdlDotNet.Input.Key.D :
                        ship.rotation-= ship.TURNING_SPEED;
                        break;
                    case SdlDotNet.Input.Key.A :
                        ship.rotation+= ship.TURNING_SPEED;
                        break;
                    case SdlDotNet.Input.Key.Escape :
                        Events.QuitApplication();
                        break;
                }

            } else {

                switch (args.Key) {
                    case SdlDotNet.Input.Key.W:
                        ship.forward = !ship.forward;
                        break;
                    case SdlDotNet.Input.Key.D:
                    case SdlDotNet.Input.Key.A:
                        ship.rotation = 0;
                        break;
                }

            }

        }
开发者ID:SamKimbinyi,项目名称:Shmup,代码行数:35,代码来源:Program.cs


示例6: Events_KeyboardDown

 private void Events_KeyboardDown(object sender, SdlDotNet.Input.KeyboardEventArgs e)
 {
     if (e.Key == links)
         left = true;
     if (e.Key == rechts)
         right = true;
 }
开发者ID:tomptrs,项目名称:RandomMapGenerator,代码行数:7,代码来源:Hero.cs


示例7: SdlDotNet_Core_Events_Tick

        public static void SdlDotNet_Core_Events_Tick(object sender, SdlDotNet.Core.TickEventArgs e)
        {
            // Only redraw the window if it isn't minimized
            //if (SdlDotNet.Graphics.Video.IsActive) {
            try {
                if (Skins.SkinManager.ScreenBackground != null && Globals.InGame == false) {
                    SdlDotNet.Graphics.Video.Screen.Blit(Skins.SkinManager.ScreenBackground, new Point(0, 0));
                } else {
                    if (Skins.SkinManager.ActiveSkin.IngameBackground != null) {
                        SdlDotNet.Graphics.Video.Screen.Blit(Skins.SkinManager.ActiveSkin.IngameBackground, new Point(0, 0));
                    } else {
                        SdlDotNet.Graphics.Video.Screen.Fill(Color.SteelBlue);
                    }
                }
            } catch {
                SdlDotNet.Graphics.Video.Screen.Fill(Color.SteelBlue);
            }

            //try {
            // Check if the FPS isn't something absurd
            //if (!(SdlDotNet.Core.Events.Fps < 10 || SdlDotNet.Core.Events.Fps > Constants.FRAME_RATE + 10)) {
            SdlDotNet.Widgets.WindowManager.DrawWindows(e);
            //} catch { }
            //}

            //if (Graphics.FontManager.GameFont != null) {
            //    SdlDotNet.Graphics.Video.Screen.Blit(Graphics.FontManager.GameFont.Render("FPS: " + SdlDotNet.Core.Events.Fps.ToString(), Color.Black), new Point(0, 0));
            //}

            SdlDotNet.Graphics.Video.Update();
            //} else {
            //    // Game window isn't active
            //}
        }
开发者ID:blastboy,项目名称:Client,代码行数:34,代码来源:SdlEventHandler.cs


示例8: Events_KeyboardDown

 void Events_KeyboardDown(object sender, SdlDotNet.Input.KeyboardEventArgs e)
 {
     if (e.Key == Key.Escape || e.Key == Key.Q)
     {
         Events.QuitApplication();
     }
 }
开发者ID:CaptBrick,项目名称:Playground,代码行数:7,代码来源:Program.cs


示例9: TextboxLine

 public TextboxLine(int maxWidth, SdlDotNet.Graphics.Font font, Color defaultForeColor)
 {
     mMaxWidth = maxWidth;
     mChars = new List<TextBoxChar>();
     mFont = font;
     mDefaultForeColor = defaultForeColor;
 }
开发者ID:ChaotixBluix,项目名称:PMU-Client,代码行数:7,代码来源:TextboxLine.cs


示例10: TextItem

 /// <summary>
 /// 
 /// </summary>
 /// <param name="font"></param>
 /// <param name="positionY"></param>
 /// <param name="phrase"></param>
 /// <param name="startTime"></param>
 public TextItem(string phrase, SdlDotNet.Graphics.Font font, int positionY, float startTime)
     : base(phrase, font, false, new Point(25, positionY))
 {
     base.Surface.Alpha = 0;
     base.Surface.AlphaBlending = true;
     this.startTime = startTime;
 }
开发者ID:erin100280,项目名称:Zelda.NET,代码行数:14,代码来源:TextItem.cs


示例11: ZX

        private string View; // View = XY, ZY or ZX (Front,Left or Top)

        #endregion Fields

        #region Constructors

        public View2D(SdlDotNet.Windows.SurfaceControl Control, string View, object _blocks, object _items, int _gridsize, object _layers)
        {
            this.View = View;
            this.Control = Control;
            this.layerStatus = (bool[])_layers;

            this.Surf = new Surface(this.Control.Width, this.Control.Height);

            this.GridSurf = new Surface(this.Control.Width, this.Control.Height);
            this.BlockSurf = new Surface(this.Control.Width, this.Control.Height);
            this.TempSurf = new Surface(this.Control.Width, this.Control.Height);

            this.GridSize = _gridsize;

            this.blocks = _blocks;
            this.items = _items;

            SdlDotNet.Core.Events.Tick +=  new EventHandler<TickEventArgs>(OnTick);

            this.levelSize = 256;

            this.scrollLocalX = this.levelSize*this.GridSize/2;
            this.scrollLocalY = this.levelSize*this.GridSize/ 2;

            this.UpdateGrid();
            this.UpdateBlocks();
            this.UpdateTemp();
        }
开发者ID:dankar,项目名称:zombies,代码行数:34,代码来源:2DView.cs


示例12: power

        public override void power(SdlDotNet.Input.KeyboardEventArgs args)
        {
            if (args.Key == SdlDotNet.Input.Key.Space)
                Console.WriteLine("Pang, pang ...");

            theHero.power(args);
        }
开发者ID:tompeetersartesis,项目名称:DesignPatternsCSharp,代码行数:7,代码来源:ShootHero.cs


示例13: Events_MouseButtonDown

 void Events_MouseButtonDown(object sender, SdlDotNet.Input.MouseButtonEventArgs e)
 {
     if (e.ButtonPressed)
     {                
         shoot = true;             
     }
 }
开发者ID:remberluyckx,项目名称:mygame,代码行数:7,代码来源:Hero.cs


示例14: Draw

        public override void Draw(SdlDotNet.Graphics.Surface screen)
        {
            // Draw the title
            titleTextSprite.X = 20;
            titleTextSprite.Y = _BaseY;
            titleTextSprite.Color = Color.Yellow;
            titleTextSprite.Text = this.Name;
            screen.Blit(titleTextSprite);

            int item_y = _BaseY + _SpaceBetweenItems + 20;
            // Draw the lines
            for (int i = 0; i < Lines.Length; i++)
            {
                lineTextSprite.X = 20;
                lineTextSprite.Y = item_y;
                lineTextSprite.Color = Color.White; 
                lineTextSprite.Text = Lines[i];
                screen.Blit(lineTextSprite);

                item_y += 15;
            }

            // Draw the item
            itemTextSprite.X = 20;
            itemTextSprite.Y = screen.Height - 40;
            itemTextSprite.Color = Color.LightYellow;
            itemTextSprite.Text = Items[0].Text;
            screen.Blit(itemTextSprite);
        }
开发者ID:ywjno,项目名称:mynes-code,代码行数:29,代码来源:Room_About.cs


示例15: BoundedTextSprite

 /// <summary>
 /// 
 /// </summary>
 /// <param name="textItem"></param>
 /// <param name="font"></param>
 /// <param name="size"></param>
 /// <param name="coordinates"></param>
 public BoundedTextSprite(
     string textItem,
     SdlDotNet.Graphics.Font font,
     Point coordinates)
     : base(textItem, font, coordinates)
 {
 }
开发者ID:erin100280,项目名称:Zelda.NET,代码行数:14,代码来源:BoundedTextSprite.cs


示例16: KeyFilterSdlConfigMappings_MouseDown

 void KeyFilterSdlConfigMappings_MouseDown(object sender, SdlDotNet.MouseButtonEventArgs e)
 {
     string mousebuttonname = MouseEventToKeyName(e);
     if (mousebuttonname != "")
     {
         HandleKeyDown(mousebuttonname);
     }
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:KeyFilterSdlConfigMappings.cs


示例17: procKeyEvent

 protected override int procKeyEvent(SdlDotNet.Input.Key key)
 {
     if (key == SdlDotNet.Input.Key.Return)
     {
         return 0;
     }
     return -1;
 }
开发者ID:davinx,项目名称:PitchPitch,代码行数:8,代码来源:SceneError.cs


示例18: Update

 public override void Update(SdlDotNet.Graphics.Surface dstSrf, SdlDotNet.Core.TickEventArgs e)
 {
     if (e.Tick > lastTick + 35) {
         mGameLoop.DrawScreen(mGameSurface, e);
         lastTick = e.Tick;
     }
     dstSrf.Blit(mGameSurface, this.Location);
 }
开发者ID:ChaotixBluix,项目名称:PMU-Client,代码行数:8,代码来源:GameCanvas.cs


示例19: renderer_KeyUp

 void renderer_KeyUp(object sender, SdlDotNet.KeyboardEventArgs e)
 {
     //Test.WriteOut("KeyFilterFormsKeyCache._KeyUp(" + e.KeyCode.ToString() + ")" );
     Keys[(int)e.Key] = false;
     if( KeyUp != null )
     {
         KeyUp(sender, e);
     }
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:9,代码来源:KeyFilterSdlKeyCache.cs


示例20: CropImage

 /// <summary>
 /// Crops a surface from the specified surface.
 /// </summary>
 /// <param name="surfaceToCrop">The surface to crop.</param>
 /// <param name="cropRectangle">The rectangle bounds to crop.</param>
 /// <returns>The cropped surface.</returns>
 public static SdlDotNet.Graphics.Surface CropImage(SdlDotNet.Graphics.Surface surfaceToCrop, System.Drawing.Rectangle cropRectangle)
 {
     SdlDotNet.Graphics.Surface returnSurf = new SdlDotNet.Graphics.Surface(cropRectangle.Size);
     returnSurf.Transparent = surfaceToCrop.Transparent;
     //returnSurf.Fill(System.Drawing.Color.Transparent);
     //returnSurf.TransparentColor = surfaceToCrop.TransparentColor;
     returnSurf.Blit(surfaceToCrop, new System.Drawing.Point(0, 0), cropRectangle);
     return returnSurf;
 }
开发者ID:blastboy,项目名称:Client,代码行数:15,代码来源:Tools.cs



注:本文中的SdlDotNet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Search类代码示例发布时间:2022-05-24
下一篇:
C# SculptType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap