Beispiel #1
0
        private void loadObjects(int width, int height)
        {
            MyObject tlo0 = new MyObject("menuTlo0", 0, 0, width, height, "background0", 0);

            tlo0.isDraw = false;
            myObjects.Add(tlo0);
            MyObject tlo1 = new MyObject("menuTlo1", 0, 0, width, height, "background1", 0);

            tlo1.isDraw = false;
            myObjects.Add(tlo1);
            MyObject tlo2 = new MyObject("menuTlo2", 0, 0, width, height, "background2", 0);

            tlo2.isDraw = false;
            myObjects.Add(tlo2);

            RoundIcon roundIcon = new RoundIcon("gwiazdki0", 0, 0, width, height, "Round1", "button1");

            icons.Add(roundIcon);
            RoundIcon roundIcon2 = new RoundIcon("gwiazdki0", roundIcon.width, 0, width, height, "Round2", "button2");

            icons.Add(roundIcon2);
            RoundIcon roundIcon3 = new RoundIcon("gwiazdki0", roundIcon.width * 2, 0, width, height, "Round3", "button3");

            icons.Add(roundIcon3);

            MySong mainSound = new MySong("bensound-funnysong", "mainSound");

            songs.Add(mainSound);
        }
Beispiel #2
0
 private bool isTouchButton(Vector2 touchPosition, RoundIcon icon)
 {
     if (touchPosition.X > icon.rectangle.X && touchPosition.X < icon.rectangle.X + icon.rectangle.Width && touchPosition.Y > icon.rectangle.Y && touchPosition.Y < icon.rectangle.Y + icon.rectangle.Height)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }