Ejemplo n.º 1
0
    public Table(ViewportUtils view, PackedScene piles)
    {
        this.view  = view;
        this.piles = piles;

        view.OnViewportResize += new ViewportUtils.OnViewportResizeDelegate(OnViewportResize);
    }
Ejemplo n.º 2
0
    public override void _Ready()
    {
        viewUtils = new ViewportUtils(GetViewport());
        viewUtils.OnViewportResize += new ViewportUtils.OnViewportResizeDelegate(OnViewportResize);

        table         = new Table(viewUtils, Piles);
        deck          = new Deck(viewUtils, Cards);
        cardPositions = new CardPositions(viewUtils);

        VisualServer.SetDefaultClearColor(BackgroundColor);
    }
Ejemplo n.º 3
0
 public CardPositions(ViewportUtils viewport)
 {
     this.viewport = viewport;
     for (int i = 0; i < 4; i++)
     {
         foundationCards.Add(new List <Card>(13));
     }
     for (int i = 0; i < 7; i++)
     {
         tableauCards.Add(new List <Card>(13));
     }
 }
Ejemplo n.º 4
0
 void Start()
 {
     character = GameObject.FindGameObjectWithTag("Character").GetComponent <Character>();
     ball      = GameObject.FindGameObjectWithTag("Ball").GetComponent <Ball>();
     vu        = GameObject.FindGameObjectWithTag("Utils").GetComponent <ViewportUtils>();
     //Ball
     highestPosY = ball.rb.position.y;
     //Set transform scale
     transform.localScale = new Vector3(vu.cameraWidth, vu.cameraHeight, 1);
     //Set tiling
     renderer.material.SetTextureScale("_MainTex", new Vector2(vu.cameraWidth, vu.cameraHeight));
     //
     topMargin = 1.5f + ball.getRadius();
 }
Ejemplo n.º 5
0
 public Deck(ViewportUtils viewport, PackedScene cardsScene)
 {
     this.cardsScene = cardsScene;
     this.viewport   = viewport;
     this.viewport.OnViewportResize += new ViewportUtils.OnViewportResizeDelegate(OnViewportResize);
 }
Ejemplo n.º 6
0
 void Start()
 {
     vu = GameObject.FindGameObjectWithTag("Utils").GetComponent <ViewportUtils>();
 }