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


C# LTexture.GetSubTexture方法代码示例

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


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

示例1: EmulatorButton

        public EmulatorButton(LTexture img, int w, int h, int x, int y,
                bool flag, int sizew, int sizeh)
        {
            this.color = new LColor(LColor.gray.R, LColor.gray.G,
                            LColor.gray.B, 125);
            img.LoadTexture();
            if (flag)
               {
                this.bitmap = img.GetSubTexture(x, y, w, h);
            }
            else
            {
                this.bitmap = img;
            }
            if (bitmap.GetWidth() != sizew || bitmap.GetHeight() != sizeh)
            {

                LTexture tmp = bitmap;
                this.bitmap = bitmap.Scale(sizew, sizeh);

                if (tmp != null)
                {
                    tmp.Dispose();
                    tmp = null;
                }
            }
            this.bounds = new RectBox(0, 0, bitmap.GetWidth(), bitmap.GetHeight());
        }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:28,代码来源:EmulatorButton.cs

示例2: GetSplit2Textures

        public static LTexture[][] GetSplit2Textures(LTexture image, int row,
                int col)
        {
            if (image == null) {
                return null;
            }
            image.LoadTexture();

            int wlength = image.Width / row;
            int hlength = image.Height / col;
            LTexture[][] textures = (LTexture[][])CollectionUtils.XNA_CreateJaggedArray(typeof(LTexture), wlength, hlength);
            for (int y = 0; y < hlength; y++) {
                for (int x = 0; x < wlength; x++) {
                    textures[x][y] = image.GetSubTexture((x * row), (y * col), row,
                            col);
                }
            }
            return textures;
        }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:19,代码来源:TextureUtils.cs

示例3: GetSplitTextures

 public static LTexture[] GetSplitTextures(LTexture image, int width, int height)
 {
     if (image == null)
     {
         return null;
     }
     image.LoadTexture();
     int frame = 0;
     int wlength = image.Width / width;
     int hlength = image.Height / height;
     int total = wlength * hlength;
     LTexture[] images = new LTexture[total];
     for (int y = 0; y < hlength; y++)
     {
         for (int x = 0; x < wlength; x++)
         {
             images[frame] = image.GetSubTexture((x * width), (y * height), width,
                     height);
             frame++;
         }
     }
     return images;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:23,代码来源:TextureUtils.cs

示例4: CopyArea

 public void CopyArea(LTexture texture, int x, int y, int width, int height,
         int dx, int dy)
 {
     if (isClose)
     {
         return;
     }
     if (x < 0)
     {
         width += x;
         x = 0;
     }
     if (y < 0)
     {
         height += y;
         y = 0;
     }
     if (texture != null)
     {
         if (x + width > texture.Width)
         {
             width = texture.Height - x;
         }
         if (y + height > texture.Height)
         {
             height = texture.Height - y;
         }
         LTexture tex2d = texture.GetSubTexture(x, y, width, height);
         DrawTexture(tex2d, x + dx, y + dy);
         tex2d = null;
     }
     else
     {
         if (x + width > GetWidth())
         {
             width = GetWidth() - x;
         }
         if (y + height > GetHeight())
         {
             height = GetHeight() - y;
         }
         LTexture tex2d = ScreenUtils.ToScreenCaptureTexture().GetSubTexture(x, y, width,
                 height);
         DrawTexture(tex2d, x + dx, y + dy);
         if (tex2d != null)
         {
             tex2d.Destroy();
             tex2d = null;
         }
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:51,代码来源:GLEx.cs


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