コード例 #1
0
        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());
        }
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: LMessage.cs プロジェクト: hellogithubtesting/LGame
 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);
 }
コード例 #4
0
ファイル: LInfo.cs プロジェクト: hellogithubtesting/LGame
 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);
 }
コード例 #5
0
ファイル: OutEffect.cs プロジェクト: hellogithubtesting/LGame
 public void Dispose()
 {
     if (texture != null)
     {
         texture.Destroy();
         texture = null;
     }
 }
コード例 #6
0
 public virtual void Dispose()
 {
     if (sakura != null)
     {
         sakura.Destroy();
         sakura = null;
     }
 }
コード例 #7
0
ファイル: Picture.cs プロジェクト: hellogithubtesting/LGame
 public virtual void Dispose()
 {
     if (image != null)
     {
         image.Dispose();
         image = null;
     }
 }
コード例 #8
0
 public virtual void Dispose()
 {
     if (snow != null)
     {
         snow.Destroy();
         snow = null;
     }
 }
コード例 #9
0
 public virtual void Dispose()
 {
     if (rain != null)
     {
         rain.Destroy();
         rain = null;
     }
 }
コード例 #10
0
ファイル: OutEffect.cs プロジェクト: hellogithubtesting/LGame
 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;
 }
コード例 #11
0
 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;
 }
コード例 #12
0
 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;
 }
コード例 #13
0
 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);
 }
コード例 #14
0
 public LTextureRegion(LTexture texture)
 {
     if (texture == null)
     {
         throw new ArgumentException("texture cannot be null.");
     }
     this.texture = texture;
     this.widthRatio = 1f;
     this.heightRatio = 1f;
     SetRegion(0, 0, texture.texWidth, texture.texHeight);
 }
コード例 #15
0
 public RainKernel(int n, int w, int h)
 {
     id = n;
     rain = XNAConfig.LoadTexture("rain_" + n + ".png");
     rainWidth = rain.GetWidth();
     rainHeight = rain.GetHeight();
     width = w;
     height = h;
     offsetX = 0;
     offsetY = (5 - n) * 30 + 75 + MathUtils.Random() * 15;
 }
コード例 #16
0
 public static void Dispose(LTexture[] images)
 {
     if (images == null)
     {
         return;
     }
     for (int i = 0; i < images.Length; i++)
     {
         images[i].Dispose();
         images[i] = null;
     }
 }
コード例 #17
0
ファイル: Picture.cs プロジェクト: hellogithubtesting/LGame
 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;
 }
コード例 #18
0
ファイル: BMFont.cs プロジェクト: hellogithubtesting/LGame
 public void Dispose()
 {
     this.isClose = true;
     if (displayList != null) {
     displayList.Destroy();
     displayList = null;
     }
     if (displays != null) {
     displays.Clear();
     displays = null;
     }
 }
コード例 #19
0
 public SnowKernel(int n, int w, int h)
 {
     snow = XNAConfig
             .LoadTexture("snow_" + n + ".png");
     snowWidth = snow.GetWidth();
     snowHeight = snow.GetHeight();
     width = w;
     height = h;
     offsetX = 0;
     offsetY = n * 0.6f + 1.9f + MathUtils.Random() * 0.2f;
     speed = MathUtils.Random();
 }
コード例 #20
0
 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;
 }
コード例 #21
0
 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);
 }
コード例 #22
0
 public PetalKernel(int n, int w, int h)
 {
     id = n;
     sakura = XNAConfig.LoadTexture("sakura_"
                     + n + ".png");
     sakuraWidth = sakura.GetWidth();
     sakuraHeight = sakura.GetHeight();
     width = w;
     height = h;
     offsetX = 0;
     offsetY = n * 0.6f + 1.9f + MathUtils.Random() * 0.2f;
     speed = MathUtils.Random();
 }
コード例 #23
0
ファイル: AVGScreen.cs プロジェクト: hellogithubtesting/LGame
 public AVGScreen(string initscript, LTexture img)
 {
     if (initscript == null)
     {
         return;
     }
     this.scriptName = initscript;
     if (img != null)
     {
         this.dialogFileName = img.GetFileName();
         this.dialog = img;
     }
 }
コード例 #24
0
ファイル: LGesture.cs プロジェクト: hellogithubtesting/LGame
 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();
     }
 }
コード例 #25
0
ファイル: LControl.cs プロジェクト: hellogithubtesting/LGame
 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();
 }
コード例 #26
0
 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;
 }
コード例 #27
0
ファイル: StatusBar.cs プロジェクト: hellogithubtesting/LGame
 public StatusBar(int value_ren, int max, int x, int y, int width, int height)
 {
     quoteCount++;
     this.value_ren = value_ren;
     this.valueMax = max;
     this.valueMin = value_ren;
     this.current = (width * value_ren) / valueMax;
     this.goal = (width * valueMin) / valueMax;
     this.width = width;
     this.height = height;
     this.visible = true;
     this.hit = true;
     this.texture = LoadBarColor(Color.Gray, Color.Red, Color.Orange);
     this.SetLocation(x, y);
 }
コード例 #28
0
 public void Begin()
 {
     if (drawing)
     {
         throw new InvalidOperationException("Not implemented end !");
     }
     if (!isInit)
     {
         batch = new Microsoft.Xna.Framework.Graphics.SpriteBatch(GLEx.device);
         isInit = true;
     }
     lastTexture = null;
     mode = -1;
     idx = 0;
     drawing = true;
 }
コード例 #29
0
ファイル: LButton.cs プロジェクト: hellogithubtesting/LGame
 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();
     }
 }
コード例 #30
0
ファイル: LPad.cs プロジェクト: hellogithubtesting/LGame
 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;
 }