コード例 #1
0
        // Here we initialize our app.
        public override void Setup()
        {
            // Load up the list of images.
            mImageNames = LoadImageIndex();

            // Loop through all the cubes and set them up.
            foreach (Cube cube in CubeSet)
            {
                // Create a wrapper object for each cube. The wrapper object allows us
                // to bundle a cube with extra information and behavior.
                CubeWrapper wrapper = new CubeWrapper(this, cube);
                mWrappers.Add(wrapper);
                wrapper.DrawSlide();
                wrapper.DrawIce();
            }

            // ## Event Handlers ##
            // Objects in the Sifteo API (particularly BaseApp, CubeSet, and Cube)
            // fire events to notify an app of various happenings, including actions
            // that the player performs on the cubes.
            //
            // To listen for an event, just add the handler method to the event. The
            // handler method must have the correct signature to be added. Refer to
            // the API documentation or look at the examples below to get a sense of
            // the correct signatures for various events.
            //
            // **NeighborAddEvent** and **NeighborRemoveEvent** are triggered when
            // the player puts two cubes together or separates two neighbored cubes.
            // These events are fired by CubeSet instead of Cube because they involve
            // interaction between two Cube objects. (There are Cube-level neighbor
            // events as well, which comes in handy in certain situations, but most
            // of the time you will find the CubeSet-level events to be more useful.)
            //CubeSet.NeighborAddEvent += OnNeighborAdd;
            //CubeSet.NeighborRemoveEvent += OnNeighborRemove;
        }
コード例 #2
0
    // Here we initialize our app.
    public override void Setup() {

      // Load up the list of images.
      mImageNames = LoadImageIndex();

      // Loop through all the cubes and set them up.
      foreach (Cube cube in CubeSet) {

        // Create a wrapper object for each cube. The wrapper object allows us
        // to bundle a cube with extra information and behavior.
        CubeWrapper wrapper = new CubeWrapper(this, cube);
        mWrappers.Add(wrapper);
        wrapper.DrawSlide();
		wrapper.DrawIce();
      }

      // ## Event Handlers ##
      // Objects in the Sifteo API (particularly BaseApp, CubeSet, and Cube)
      // fire events to notify an app of various happenings, including actions
      // that the player performs on the cubes.
      //
      // To listen for an event, just add the handler method to the event. The
      // handler method must have the correct signature to be added. Refer to
      // the API documentation or look at the examples below to get a sense of
      // the correct signatures for various events.
      //
      // **NeighborAddEvent** and **NeighborRemoveEvent** are triggered when
      // the player puts two cubes together or separates two neighbored cubes.
      // These events are fired by CubeSet instead of Cube because they involve
      // interaction between two Cube objects. (There are Cube-level neighbor
      // events as well, which comes in handy in certain situations, but most
      // of the time you will find the CubeSet-level events to be more useful.)
      //CubeSet.NeighborAddEvent += OnNeighborAdd;
      //CubeSet.NeighborRemoveEvent += OnNeighborRemove;
    }