当前位置: 首页>>代码示例>>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;未经允许,请勿转载。