当前位置: 首页>>代码示例>>C#>>正文


C# Surface.CreateFlippedVerticalSurface方法代码示例

本文整理汇总了C#中SdlDotNet.Graphics.Surface.CreateFlippedVerticalSurface方法的典型用法代码示例。如果您正苦于以下问题:C# Surface.CreateFlippedVerticalSurface方法的具体用法?C# Surface.CreateFlippedVerticalSurface怎么用?C# Surface.CreateFlippedVerticalSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SdlDotNet.Graphics.Surface的用法示例。


在下文中一共展示了Surface.CreateFlippedVerticalSurface方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DarknessOverlay

        public DarknessOverlay(int newRange)
        {
            disposed = false;
            range = newRange;
            buffer = new Surface(40 * Constants.TILE_WIDTH, 30 * Constants.TILE_HEIGHT);
            Surface holepart = new Surface(14 * Constants.TILE_WIDTH, 14 * Constants.TILE_HEIGHT);
            for (int x = 0; x < 14; x++) {
                for (int y = 0; y < 14; y++) {
                    holepart.Blit(GraphicsManager.Tiles[10][210 + x + 14 * y], new Point(x * Constants.TILE_WIDTH, y * Constants.TILE_HEIGHT));
                }
            }

            Surface hole = new Surface(28 * Constants.TILE_WIDTH, 28 * Constants.TILE_HEIGHT);
            hole.Blit(holepart, new Point(0,0));
            hole.Blit(holepart.CreateFlippedHorizontalSurface(), new Point(hole.Width / 2, -2));
            hole.Blit(holepart.CreateFlippedVerticalSurface(), new Point(0, hole.Height / 2));
            hole.Blit(holepart.CreateFlippedVerticalSurface().CreateFlippedHorizontalSurface(), new Point(hole.Width / 2, hole.Height / 2 - 2));
            hole = hole.CreateStretchedSurface(new Size((range) * Constants.TILE_WIDTH, (range) * Constants.TILE_HEIGHT));

            buffer.Blit(GraphicsManager.Tiles[10][45].CreateStretchedSurface(new Size(40 * Constants.TILE_WIDTH, 30 * Constants.TILE_HEIGHT)), new Point(0,0));
            buffer.Blit(hole, new Point(buffer.Width / 2 - hole.Width / 2, buffer.Height / 2 - hole.Height / 2));

            //buffer = hole;
            buffer.Transparent = true;

            buffer.AlphaBlending = true;
            buffer.Alpha = 180;
        }
开发者ID:blastboy,项目名称:Client,代码行数:28,代码来源:DarknessOverlay.cs

示例2: Events_TickEvent

        private void Events_TickEvent(object sender, TickEventArgs e)
        {
            try
            {
                font.Style = (Styles)styleArray[rand.Next(styleArray.Length)];
                text = font.Render(
                    textArray[rand.Next(textArray.Length)],
                    Color.FromArgb(0, (byte)rand.Next(255),
                    (byte)rand.Next(255), (byte)rand.Next(255)));

                switch (rand.Next(4))
                {
                    case 1:
                        text = text.CreateFlippedVerticalSurface();
                        break;
                    case 2:
                        text = text.CreateFlippedHorizontalSurface();
                        break;
                    case 3:
                        text = text.CreateRotatedSurface(rand.Next(360));
                        break;
                    default:
                        break;
                }

                screen.Blit(
                    text,
                    new Rectangle(new Point(rand.Next(width - 100), rand.Next(height - 100)),
                    text.Size));
                screen.Update();
                Thread.Sleep(500);
            }
            catch
            {
                //sdl.Dispose();
                throw;
            }
        }
开发者ID:erin100280,项目名称:Zelda.NET,代码行数:38,代码来源:FontExample.cs


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