當前位置: 首頁>>代碼示例>>C#>>正文


C# Sifteo.Cube類代碼示例

本文整理匯總了C#中Sifteo.Cube的典型用法代碼示例。如果您正苦於以下問題:C# Cube類的具體用法?C# Cube怎麽用?C# Cube使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Cube類屬於Sifteo命名空間,在下文中一共展示了Cube類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnButton

 private void OnButton(Cube cube, bool pressed)
 {
     if (pressed) {
     Sound sound = app.sounds[app.imageNames[app.wrappers[cube.UniqueId].index]];
     sound.Play(1,0);
     }
 }
開發者ID:gertjana,項目名稱:AnimalMatch,代碼行數:7,代碼來源:CubeWrapper.cs

示例2: SiftOscCubeEvent

 public SiftOscCubeEvent(Cube cube, OscClient client, IPEndPoint endPoint, List<SiftOscEventMessage> messages)
 {
     this.cube = cube;
       this.client = client;
       this.endPoint = endPoint;
       this.messages = messages;
 }
開發者ID:kellydunn,項目名稱:siftosc,代碼行數:7,代碼來源:SiftOscCubeEvent.cs

示例3: CubeWrapper

        public CubeWrapper(MathScramble app, Cube cube, int seq)
        {
            mApp = app;
            mCube = cube;
            mCube.userData = this;
            mSpriteIndex = 0;
            //mRectColor = new Color (36, 182, 255);
            //mSelectColor = new Color (255, 0, 0);
            mRotation = 0;
            mCube.TiltEvent += OnTilt;
            mIndex = seq;

            mCube.ButtonEvent += HandleCubeButtonEvent;
            mCube.ShakeStartedEvent += HandleMCubeShakeStartedEvent;

            //Init the State Machine
            mRole = mApp.cubeStates [seq - 1];
            InitStateMachine ();

            //
            mValue = mRole.GenerateValue ();
            mColor = mRole.mColor;
            mSize = mRole.mSize;

            /*
            if (mCubeStateMachine.Current == Constants.HintState) {
                mNeedDraw = true;
                Tick ();
            }*/

            //
        }
開發者ID:cdesch,項目名稱:MathScramble,代碼行數:32,代碼來源:MathScramble.cs

示例4: CubeEventReporter

 public CubeEventReporter(JsonTcpCommunication com, Cube c)
 {
     _com = com;
     _c = c;
     Reporters.Add (this);
     ReportAllEvents ();
 }
開發者ID:raabmar,項目名稱:The-Tangibles,代碼行數:7,代碼來源:CubeEventReporter.cs

示例5: getFaderHelper

 public static FaderHelper getFaderHelper(Cube c)
 {
     if (!_lookup.ContainsKey (c.UniqueId)) {
         _lookup [c.UniqueId] = new FaderHelper (c);
     }
     return _lookup [c.UniqueId];
 }
開發者ID:raabmar,項目名稱:The-Tangibles,代碼行數:7,代碼來源:FaderHelper.cs

示例6: CubeWrapper

        public CubeWrapper(EColiTest app, Cube cube)
        {
            mApp = app;
            mCube = cube;
            mCube.userData = this; 

            //Ensures that whatever color first appears on the cube is the color instance variable
            if (mCubeType == 0)
            {
                if (mApp.mImageNames[colorIndex].Contains("red")) this.color = "red";
                if (mApp.mImageNames[colorIndex].Contains("blue")) this.color = "blue";
                if (mApp.mImageNames[colorIndex].Contains("yellow")) this.color = "yellow";
            }

            mApp.whitePlasmidController.mCube = this.mCube;
            
            eColiColor = "white";
            plasmidColor = "white";

            //Adding the event handlers
            mCube.ButtonEvent += OnButton;
            mCube.TiltEvent += OnTilt;
            mCube.FlipEvent += OnFlip;

        }
開發者ID:cvaldes2328,項目名稱:SynFloSifteo1.0App,代碼行數:25,代碼來源:CubeWrapper.cs

示例7: OnTilt

        private void OnTilt(Cube cube, Cube.Side direction)
        {
            switch (direction)
            {
                case Cube.Side.TOP:
                    cube.FillRect(new Color(0, 200, 0), 54, 54, 20, 20); // increasingly dark green
                    break;

                case Cube.Side.BOTTOM:
                    cube.FillRect(new Color(0, 150, 0), 54, 54, 20, 20);
                    break;

                case Cube.Side.LEFT:
                    cube.FillRect(new Color(0, 100, 0), 54, 54, 20, 20);
                    break;

                case Cube.Side.RIGHT:
                    cube.FillRect(new Color(0, 50, 0), 54, 54, 20, 20);
                    break;
                default:
                    cube.FillRect(Color.White, 54, 54, 20, 20); // extremely light green
                    break;
            }

            cube.Paint();
        }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:26,代碼來源:CubeTestApp.cs

示例8: addPrimary

 int addPrimary(Cube a, Cube b)
 {
     if (a.Neighbors.Right != null || a.Neighbors.Bottom != null)
         AddCubeToArray (a,0);
     else
         AddCubeToArray(b,0);
     return 0;
 }
開發者ID:quinkennedy,項目名稱:YouCompleteMe,代碼行數:8,代碼來源:YouCompleteMe.cs

示例9: OnPress

 private void OnPress(Cube cube, bool press)
 {
     if (!this.justPressed)
       {
       Console.WriteLine("Button pressed");
       app.Answer(cube);
       }
       this.justPressed = !this.justPressed;
 }
開發者ID:veatchje,項目名稱:Siftables-477,代碼行數:9,代碼來源:ReflexSifteoApp.cs

示例10: OperatorController

        public OperatorController(Cube cube)
        {
            Log.Debug (classname + " Init");
            mCube = cube;
            mWrapper = (CubeWrapper)cube.userData;

            mCube.NeighborAddEvent += OnNeighborAdd;
            mCube.NeighborRemoveEvent += OnNeighborRemove;
        }
開發者ID:cdesch,項目名稱:MathScramble,代碼行數:9,代碼來源:OperatorController.cs

示例11: NeighborAddNotification

 private void NeighborAddNotification(Cube c, Cube.Side side, Cube neighbor, Cube.Side neighborSide)
 {
     Dictionary<String, Object> parameters = new Dictionary<String, Object> ();
     String msg = "neighborAdded";
     parameters.Add ("neighborId", neighbor.UniqueId);
     parameters.Add ("cubeSide", side.ToString ());
     parameters.Add ("neighborSide", neighborSide.ToString ());
     this.NotifyEvent (msg, c, parameters);
 }
開發者ID:raabmar,項目名稱:The-Tangibles,代碼行數:9,代碼來源:CubeEventReporter.cs

示例12: StringPainter

        /*
         * Constructor with color and size
         */
        public StringPainter(Cube cube, String label, System.Drawing.Color color, int size)
        {
            Log.Debug ("StringPainter {0}", label);
            mCube = cube;

            fontSize = size;
            fontColor = color;
            writeWord (label, mCube);
        }
開發者ID:cdesch,項目名稱:ThreeCardMonte,代碼行數:12,代碼來源:StringPainter.cs

示例13: CubeWrapper

 public CubeWrapper(SorterApp app, Cube cube, int seq)
 {
     mApp = app;
       mCube = cube;
       mCube.userData = this;
       mSpriteIndex = 0;
       mRectColor = new Color(36, 182, 255);
       mIndex = seq;
 }
開發者ID:ivanpike,項目名稱:02_sifteo_neighborfillscreen,代碼行數:9,代碼來源:SorterApp.cs

示例14: StringPainter

        /*
         * Constructor with color and size
         */
        public StringPainter(Cube cube, String label, System.Drawing.Color color, float size)
        {
            Log.Debug ("StringPainter {0}", label);
            mCube = cube;

            fontSize = size;
            //fontColor = System.Drawing.Color.FromArgb (color.Data);
            fontColor = color;
            writeWord (label, mCube);
        }
開發者ID:cdesch,項目名稱:MathScramble,代碼行數:13,代碼來源:StringPainter.cs

示例15: ButtonNotification

 private void ButtonNotification(Cube c, bool isPressed)
 {
     String msg;
     if (isPressed) {
         msg = "pressed";
     } else {
         msg = "released";
     }
     this.NotifyEvent (msg, c);
 }
開發者ID:raabmar,項目名稱:The-Tangibles,代碼行數:10,代碼來源:CubeEventReporter.cs


注:本文中的Sifteo.Cube類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。