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

C# OpenGL.LTexture类代码示例

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

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



LTexture类属于Loon.Core.Graphics.OpenGL命名空间,在下文中一共展示了LTexture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: CreateShadowTexture

 public static LTexture CreateShadowTexture(LTexture texture, float alpha,
         float scale, float angle)
 {
     int width = texture.Width;
     int height = texture.Height;
     LPixmap image = new LPixmap(texture);
     int centerX = width / 2;
     int centerY = height / 2;
     int offsetX = (int)((width - image.Width) / 2);
     int offsetY = (int)((height - image.Height) / 2);
     Loon.Core.Geom.Matrix.Transform2i t = new Loon.Core.Geom.Matrix.Transform2i();
     t.Rotate(angle, centerX, centerY);
     t.Zoom(scale, centerX, centerY);
     LPixmap shadowProcess = new LPixmap(width, height,
             image.IsAlpha());
     shadowProcess.DrawPixmap(image, offsetX, offsetY);
     shadowProcess.Transparency();
     shadowProcess.Mul(255, 0, 0, 0);
     shadowProcess.Mul((int)(alpha * 255), 255, 255, 255);
     shadowProcess.Convolve(LPixmap.GaussianBlurKernel());
     shadowProcess.Transform(t);
     if (image != null)
     {
         image.Dispose();
         image = null;
     }
     return shadowProcess.Texture;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:28,代码来源:TextureUtils.cs


示例3: LMessage

 public LMessage(LTexture formImage, int x, int y, int width, int height)
     : base(x, y, width, height)
 {
     this.animation = new Animation();
     if (formImage == null)
     {
         this.SetBackground(new LTexture(width, height, true));
         this.SetAlpha(0.3F);
     }
     else
     {
         this.SetBackground(formImage);
         if (width == -1)
         {
             width = formImage.GetWidth();
         }
         if (height == -1)
         {
             height = formImage.GetHeight();
         }
     }
     this.print = new Print(GetLocation(), messageFont, width, height);
     if (XNAConfig.IsActive())
     {
         this.SetTipIcon(XNAConfig.LoadTex(LSystem.FRAMEWORK_IMG_NAME + "creese.png"));
     }
     this.totalDuration = 80;
     this.customRendering = true;
     this.SetWait(false);
     this.SetElastic(true);
     this.SetLocked(true);
     this.SetLayer(100);
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:33,代码来源:LMessage.cs


示例4: LInfo

 public LInfo(LTexture formImage, int x, int y, int width, int height)
     : base(x, y, width, height)
 {
     fontSize = deffont.GetSize();
     if (formImage == null)
     {
         this.SetBackground(new LTexture(width, height, true));
         this.SetAlpha(0.3F);
     }
     else
     {
         this.SetBackground(formImage);
         if (width == -1)
         {
             width = formImage.GetWidth();
         }
         if (height == -1)
         {
             height = formImage.GetHeight();
         }
     }
     this.message_char_count = 0;
     this.message_x = new int[messageCountMax];
     this.message_y = new int[messageCountMax];
     this.locatePoint = new List<LocatePoint>();
     this.flag = new FlagImage(this);
     this.customRendering = true;
     this.SetElastic(true);
     this.SetLayer(100);
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:30,代码来源:LInfo.cs


示例5: OutEffect

 public OutEffect(LTexture t, RectBox limit, int code)
 {
     this.texture = t;
     this.type = code;
     this.width = t.Width;
     this.height = t.Height;
     this.multiples = 1;
     this.limit = limit;
     this.visible = true;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:10,代码来源:OutEffect.cs


示例6: SpriteSheet

 public SpriteSheet(LTexture img, int tw, int th, int s, int m)
 {
     this.width = img.GetWidth();
     this.height = img.GetHeight();
     this.target = img;
     this.tw = tw;
     this.th = th;
     this.margin = m;
     this.spacing = s;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:10,代码来源:SpriteSheet.cs


示例7: ScrollEffect

 public ScrollEffect(int d, LTexture tex2d, float x, float y, int w, int h)
 {
     this.SetLocation(x, y);
     this.texture = tex2d;
     this.width = w;
     this.height = h;
     this.count = 1;
     this.timer = new LTimer(10);
     this.visible = true;
     this.code = d;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:11,代码来源:ScrollEffect.cs


示例8: LTextureRegion

 public LTextureRegion(LTexture texture, int x, int y, int width, int height)
 {
     if (texture == null)
     {
         throw new ArgumentException("texture cannot be null.");
     }
     this.texture = texture;
     this.widthRatio = 1f;
     this.heightRatio = 1f;
     SetRegion(x, y, width, height);
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:11,代码来源:LTextureRegion.cs


示例9: Dispose

 public static void Dispose(LTexture[] images)
 {
     if (images == null)
     {
         return;
     }
     for (int i = 0; i < images.Length; i++)
     {
         images[i].Dispose();
         images[i] = null;
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:12,代码来源:AnimationHelper.cs


示例10: Picture

 public Picture(LTexture i, int x, int y)
 {
     this.alpha = 1f;
     if (i != null)
     {
         this.SetImage(i);
         this.width = i.GetWidth();
         this.height = i.GetHeight();
     }
     this.SetLocation(x, y);
     this.visible = true;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:12,代码来源:Picture.cs


示例11: NewCross

 public static LTransition NewCross(int c, LTexture texture)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Cross(c, texture));
         transition.SetDisplayGameUI(true);
         transition.code = 1;
         return transition;
     }
     return null;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:12,代码来源:LTransition.cs


示例12: SpriteRegion

 public SpriteRegion(LTexture texture, int srcX, int srcY, int srcWidth,
         int srcHeight)
 {
     if (texture == null)
     {
         throw new ArgumentException("texture cannot be null.");
     }
     this.texture = texture;
     SetRegion(srcX, srcY, srcWidth, srcHeight);
     SetColor(1f, 1f, 1f, 1f);
     SetSize(Math.Abs(srcWidth), Math.Abs(srcHeight));
     SetOrigin(width / 2, height / 2);
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:13,代码来源:SpriteRegion.cs


示例13: AVGScreen

 public AVGScreen(string initscript, LTexture img)
 {
     if (initscript == null)
     {
         return;
     }
     this.scriptName = initscript;
     if (img != null)
     {
         this.dialogFileName = img.GetFileName();
         this.dialog = img;
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:13,代码来源:AVGScreen.cs


示例14: CreateUI

 public override void CreateUI(GLEx g, int x, int y, LComponent component,
         LTexture[] buttonImage)
 {
     if (visible && goalPath != null)
     {
         g.SetLineWidth(lineWidth);
         g.GLBegin(GL.GL_LINE_STRIP);
         g.Draw(goalPath, color);
         g.GLEnd();
         g.ResetLineWidth();
         g.ResetColor();
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:13,代码来源:LGesture.cs


示例15: LControl

 public LControl(int x, int y, LTexture bs, LTexture dot, int bw, int bh,
         int dw, int dh)
     : base(x, y, bw, bh)
 {
     this.controlBase = bs;
     this.controlDot = dot;
     this.baseWidth = bw;
     this.baseHeight = bh;
     this.dotWidth = dw;
     this.dotHeight = dh;
     this.allowDiagonal = true;
     this.CenterOffset();
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:13,代码来源:LControl.cs


示例16: CrossEffect

 public CrossEffect(int c, LTexture o, LTexture n)
 {
     this.code = c;
     this.otexture = o;
     this.ntexture = n;
     this.width = o.GetWidth();
     this.height = o.GetHeight();
     if (width > height) {
     maxcount = 16;
     } else {
     maxcount = 8;
     }
     this.timer = new LTimer(160);
     this.visible = true;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:15,代码来源:CrossEffect.cs


示例17: CreateUI

 public override void CreateUI(GLEx g, int x, int y, LComponent component,
         LTexture[] buttonImage)
 {
     LButton button = (LButton)component;
     if (buttonImage != null)
     {
         if (!button.IsEnabled())
         {
             g.DrawTexture(buttonImage[3], x, y);
         }
         else if (button.IsTouchPressed())
         {
             g.DrawTexture(buttonImage[2], x, y);
         }
         else if (button.IsTouchOver())
         {
             g.DrawTexture(buttonImage[1], x, y);
         }
         else
         {
             if (type == 1)
             {
                 g.DrawTexture(buttonImage[0], x, y, LColor.gray);
             }
             else
             {
                 g.DrawTexture(buttonImage[0], x, y);
             }
         }
     }
     if (text != null)
     {
         LFont old = g.GetFont();
         g.SetFont(font);
         g.SetColor(fontColor);
         g.DrawString(
                 text,
                 x + button.GetOffsetLeft()
                         + (button.GetWidth() - font.StringWidth(text)) / 2,
                 y + button.GetOffsetTop()
                         + (button.GetHeight() - font.GetLineHeight()) / 2
                         + font.GetLineHeight());
         g.SetFont(old);
         g.ResetColor();
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:46,代码来源:LButton.cs


示例18: LPad

 public LPad(int x, int y, LTexture b, LTexture f, LTexture d, float scale)
     : base(x, y, (int)(f.GetWidth() * scale), (int)(f.GetHeight() * scale))
 {
     this.offsetX = 6 * scale;
     this.offsetY = 6 * scale;
     this.fore = f;
     this.back = b;
     this.dot = d;
     this.dotWidth = (int)(d.GetWidth() * scale);
     this.dotHeight = (int)(d.GetHeight() * scale);
     this.baseWidth = (int)(f.GetWidth() * scale);
     this.baseHeight = (int)(f.GetHeight() * scale);
     this.backWidth = (int)(b.GetWidth() * scale);
     this.backHeight = (int)(b.GetHeight() * scale);
     this.centerX = (baseWidth - dotWidth) / 2 + offsetX;
     this.centerY = (baseHeight - dotHeight) / 2 + offsetY;
     this.scale_pad = scale;
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:18,代码来源:LPad.cs


示例19: Dispose

 public void Dispose()
 {
     if (texture != null)
     {
         texture.Destroy();
         texture = null;
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:8,代码来源:OutEffect.cs


示例20: Dispose

 public virtual void Dispose()
 {
     if (sakura != null)
     {
         sakura.Destroy();
         sakura = null;
     }
 }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:8,代码来源:PetalKernel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Opengl.LTexture类代码示例发布时间:2022-05-26
下一篇:
C# Graphics.LColor类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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