コード例 #1
0
    public void Init(FContainer container, uint color, bool shouldUpdateColliders)
    {
        _container = container;

        _container.AddChild(_drawHolder = new FContainer());

        _color = RXColor.GetColorFromHex(color);

        this.shouldUpdateColliders = shouldUpdateColliders;

        Collider[] colliders = gameObject.GetComponents <Collider>();

        int colliderCount = colliders.Length;

        for (int c = 0; c < colliderCount; c++)
        {
            Collider collider = colliders[c];

            FNode newNode = null;

            if (collider is BoxCollider)
            {
                FSprite sprite = new FSprite("Debug/Square");
                sprite.color = _color;

                newNode = sprite;
            }
            else if (collider is SphereCollider)
            {
                FSprite sprite = new FSprite("Debug/Circle");
                sprite.color = _color;

                newNode = sprite;
            }

            if (newNode != null)
            {
                _drawHolder.AddChild(newNode);
                _nodes.Add(newNode);
            }
        }

        FPPolygonalCollider mesh2D = gameObject.GetComponent <FPPolygonalCollider>();

        if (mesh2D != null)
        {
            FPDebugPolygonColliderView debugView = new FPDebugPolygonColliderView("Debug/Triangle", mesh2D);
            debugView.color = _color;

            _drawHolder.AddChild(debugView);
            _nodes.Add(debugView);
        }

        Update();
        if (!shouldUpdateColliders)
        {
            UpdateColliders();                                //always update the colliders the first time
        }
    }
コード例 #2
0
ファイル: PlayerColor.cs プロジェクト: MattRix/ScorekeeperX
 public PlayerColor(string name, uint hex, int soundIndex)
 {
     this.name            = name;
     this.hex             = hex;
     this.color           = RXColor.GetColorFromHex(hex);
     this.soundNormalName = "Musical/Note" + soundIndex + "_normal";
     this.soundBassName   = "Musical/Note" + soundIndex + "_bass";
 }
コード例 #3
0
    override public void Start()
    {
        FSprite sprite = new FSprite("WhiteBox");

        sprite.color = RXColor.GetColorFromHex(0xffff00);
        sprite.scale = 10.0f;
        AddChild(sprite);

        FLabel lbl = new FLabel("CubanoInnerShadow", "HELLO WORLD");

        lbl.color = Color.black;
        AddChild(lbl);
    }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        instance = this;

        Go.defaultEaseType       = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        bool landscape = true;
        bool portrait  = false;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");
        bool shouldSupportPortraitUpsideDown = isIPad && portrait;         //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(landscape, landscape, portrait, shouldSupportPortraitUpsideDown);

        fparams.backgroundColor = RXColor.GetColorFromHex(0xff00ff);

        fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "_Scale1");                  //iPhone
        fparams.AddResolutionLevel(960.0f, 2.0f, 2.0f, "_Scale2");                  //iPhone retina
        fparams.AddResolutionLevel(1024.0f, 2.0f, 2.0f, "_Scale2");                 //iPad
        fparams.AddResolutionLevel(1280.0f, 2.0f, 2.0f, "_Scale2");                 //Nexus 7
        fparams.AddResolutionLevel(2048.0f, 4.0f, 4.0f, "_Scale4");                 //iPad Retina

        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/UIFonts");
        Futile.atlasManager.LoadAtlas("Atlases/GameAtlas");

        FTextParams textParams;

        textParams = new FTextParams();
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("Franchise", "FranchiseFont" + Futile.resourceSuffix, "Atlases/FranchiseFont" + Futile.resourceSuffix, -2.0f, -5.0f, textParams);

        textParams = new FTextParams();
        textParams.kerningOffset    = -0.5f;
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("CubanoInnerShadow", "Cubano_InnerShadow" + Futile.resourceSuffix, "Atlases/CubanoInnerShadow" + Futile.resourceSuffix, 0.0f, 2.0f, textParams);

        GoToPage(PageType.MainPage);
    }
コード例 #5
0
ファイル: PlayerManager.cs プロジェクト: MattRix/BewareWolf
 public PlayerColor(string name, uint hex)
 {
     this.name  = name;
     this.color = RXColor.GetColorFromHex(hex);
 }