Exemple #1
0
        public EmulatorButtons(EmulatorListener el, int w, int h, float scale)
        {
            this.emulatorListener = el;
            this.dpad             = XNAConfig.LoadTexture("e1.png");
            this.buttons          = XNAConfig.LoadTexture("e2.png");

            this.width  = w;
            this.height = h;

            if (scale <= 1f)
            {
                this.up    = new EmulatorButton(dpad, 40, 40, 40, 0, true, 60, 60);
                this.left  = new EmulatorButton(dpad, 40, 40, 0, 40, true, 60, 60);
                this.right = new EmulatorButton(dpad, 40, 40, 80, 40, true, 60, 60);
                this.down  = new EmulatorButton(dpad, 40, 40, 40, 80, true, 60, 60);

                this.triangle = new EmulatorButton(buttons, 48, 48, 48, 0, true,
                                                   68, 68);
                this.square = new EmulatorButton(buttons, 48, 48, 0, 48, true, 68,
                                                 68);
                this.circle = new EmulatorButton(buttons, 48, 48, 96, 48, true, 68,
                                                 68);
                this.cancel = new EmulatorButton(buttons, 48, 48, 48, 96, true, 68,
                                                 68);
            }
            else
            {
                this.up = new EmulatorButton(dpad, 40, 40, 40, 0, true,
                                             (int)(60 * scale), (int)(60 * scale));
                this.left = new EmulatorButton(dpad, 40, 40, 0, 40, true,
                                               (int)(60 * scale), (int)(60 * scale));
                this.right = new EmulatorButton(dpad, 40, 40, 80, 40, true,
                                                (int)(60 * scale), (int)(60 * scale));
                this.down = new EmulatorButton(dpad, 40, 40, 40, 80, true,
                                               (int)(60 * scale), (int)(60 * scale));

                this.triangle = new EmulatorButton(buttons, 48, 48, 48, 0, true,
                                                   (int)(68 * scale), (int)(68 * scale));
                this.square = new EmulatorButton(buttons, 48, 48, 0, 48, true,
                                                 (int)(68 * scale), (int)(68 * scale));
                this.circle = new EmulatorButton(buttons, 48, 48, 96, 48, true,
                                                 (int)(68 * scale), (int)(68 * scale));
                this.cancel = new EmulatorButton(buttons, 48, 48, 48, 96, true,
                                                 (int)(68 * scale), (int)(68 * scale));
            }

            if (dpad != null)
            {
                dpad.Dispose();
                dpad = null;
            }
            if (buttons != null)
            {
                buttons.Dispose();
                buttons = null;
            }
            this.visible = true;

            this.SetLocation(0, 0);
        }
Exemple #2
0
 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.LoadTexture("creese.png"));
     }
     this.totalDuration   = 80;
     this.customRendering = true;
     this.SetWait(false);
     this.SetElastic(true);
     this.SetLocked(true);
     this.SetLayer(100);
 }
Exemple #3
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;
 }
Exemple #4
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();
 }
Exemple #5
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();
 }
Exemple #6
0
 public LSelect(LTexture formImage, int x, int y, int width, int height) : base(x, y, width, height)
 {
     if (formImage == null)
     {
         this.SetBackground(new LTexture(width, height, true));
         this.SetAlpha(0.3F);
     }
     else
     {
         this.SetBackground(formImage);
     }
     this.customRendering = true;
     this.selectFlag      = 1;
     this.tmpOffset       = -(width / 10);
     this.delay           = new LTimer(150);
     this.autoAlpha       = 0.25F;
     this.isAutoAlpha     = true;
     this.SetCursor(XNAConfig.LoadTexture("creese.png"));
     this.SetElastic(true);
     this.SetLocked(true);
     this.SetLayer(100);
 }
Exemple #7
0
 public FlagImage(LInfo i)
 {
     this.info = i;
     // 读取基础标记
     if (page == null || (page != null && page.isClose))
     {
         if (page != null)
         {
             page.Destroy();
             page = null;
         }
         page = XNAConfig.LoadTexture("page.png");
     }
     if (line == null || (line != null && line.isClose))
     {
         if (line != null)
         {
             line.Destroy();
             line = null;
         }
         line = XNAConfig.LoadTexture("line.png");
     }
     texture = page;
 }
Exemple #8
0
 public LControl(int x, int y, int bw, int bh, int dw, int dh) :  this(x, y, XNAConfig.LoadTexture(
                                                                           "control_base.png"), XNAConfig.LoadTexture("control_dot.png"),
                                                                       bw, bh, dw, dh)
 {
 }
Exemple #9
0
 public LPad(int x, int y, float scale)
     : this(x, y, XNAConfig.LoadTexture("pad_ui_back.png"), XNAConfig.LoadTexture("pad_ui_fore.png"),
            XNAConfig.LoadTexture("pad_ui_dot.png"), scale)
 {
 }