Layaair Engine--(eight)

Source: Internet
Author: User
Tags addchild change settings

var a = new Array (), var b = new Array (), var ksjmcursor = 0;function Ksjminit () {ksjminitname ();    Ksjminitrectchoose ();    Ksjminitrectchoosepic ();    Ksjmsetvisible (0); Laya.stage.on (Laya.events.Event.KEY_DOWN, this, ksjmonkeydown);}    function Ksjminitname () {var a1 = new Laya.display.Text ();    A1.text = "Go on a journey of adventure";    a1.x = 50;    A1.Y = 50;    A1.color = "Red";    A1.fontsize = 20;    Laya.stage.addChild (A1);    var a2 = new Laya.display.Text ();    A2.text = "A new adventure trip";    a2.x = 50;    A2.Y = 50 + 30 * 1;    A2.color = "Red";    A2.fontsize = 20;    Laya.stage.addChild (A2);    var a3 = new Laya.display.Text ();    A3.text = "The heritage of the adventurers";    a3.x = 50;    A3.Y = 50 + 30 * 2;    A3.color = "Red";    A3.fontsize = 20;    Laya.stage.addChild (A3);    var a4 = new Laya.display.Text ();    A4.text = "Open Web page";    a4.x = 50;    A4.Y = 50 + 30 * 3;    A4.color = "Red";    A4.fontsize = 20;    Laya.stage.addChild (A4);    var A5 = new Laya.display.Text ();    A5.text = "Change settings";    a5.x = 50;A5.Y = 50 + 30 * 4;    A5.color = "Red";    A5.fontsize = 20;    Laya.stage.addChild (A5);    var a6 = new Laya.display.Text ();    A6.text = "Exit";    a6.x = 50;    A6.Y = 50 + 30 * 5;    A6.color = "Red";    A6.fontsize = 20; Laya.stage.addChild (A6);}        function Ksjminitrectchoose () {for (var i = 0; i < 6; i++) {A[i] = new Laya.display.Sprite ();        if (i = = 0 | | i = = 1 | | i = = 2) {A[i].graphics.drawrect (+ + + * I, 6 * + 5 +, +, "white");        } if (i = = 3 | | i = = 4) {A[i].graphics.drawrect (+ +) * I, 3 * + 5 + +, +, "white");        } if (i = = 5) {A[i].graphics.drawrect (+), 2 * + 5 + ten, "white");        } A[i].alpha = 0.25;        A[i].visible = true;    Laya.stage.addChild (A[i]);        }}function Ksjminitrectchoosepic () {for (var i = 0; i < 6; i++) {B[i] = new Laya.display.Sprite (); if (i = = 0 | | i = = 1 | | i = = 2) {b[i].loadimage ("rectChoosepic.png ", 6 + * + 5, + + * i + 5, 10, 10);        } if (i = = 3 | | i = = 4) {b[i].loadimage ("rectchoosepic.png", + 4 * + 5, + + * i + 5, 10, 10);        } if (i = = 5) {b[i].loadimage ("rectchoosepic.png", + 2 * + 5, + + * i + 5, 10, 10);        } b[i].visible = true;    Laya.stage.addChild (B[i]);                }}function Ksjmonkeydown (e) {switch (e.keycode) {case 38:{if ((ksjmCursor-1) <= 0) {            ksjmcursor = 0;            }else{ksjmcursor--;        } break;            } Case 40:{if ((Ksjmcursor + 1) >= 5) {ksjmcursor = 5;            }else{ksjmcursor++;        } break; }} ksjmsetvisible (Ksjmcursor);} function Ksjmsetvisible (index) {for (var i = 0; i < 6; i++) {if (index = = i) {a[i].visible = Tru            E        B[i].visible = true;  }else{          A[i].visible = false;        B[i].visible = false; }    }}

  

Layaair Engine--(eight)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.