Example #1
0
    public void addPerson()
    {
        guyLeft  = resourceFactory.Create(this, "GuyLeft").GetComponent <Sprite>();
        guyRight = resourceFactory.Create(this, "GuyRight").GetComponent <Sprite>();

        guyLeft.setScreenPosition((int)camera.pixelWidth / 2 - guyLeft.PixelWidth() + guyCenterOffset,
                                  (int)camera.pixelHeight / 2 - guyLeft.PixelHeight() / 2);
        guyRight.setScreenPosition((int)camera.pixelWidth / 2 + guyCenterOffset,
                                   (int)camera.pixelHeight / 2 - guyRight.PixelHeight() / 2);
        guyLeftInitialPosition  = guyLeft.getScreenPosition();
        guyRightInitialPosition = guyRight.getScreenPosition();

        eyes = resourceFactory.Create(this, "EyesOpening");
        eyes.GetComponent <Sprite>().setWorldPosition(-5.5f, 36.5f, -1f);
    }
Example #2
0
    public void addPerson()
    {
        guyLeft = resourceFactory.Create(this, "GuyLeft").GetComponent<Sprite>();
        guyRight = resourceFactory.Create(this, "GuyRight").GetComponent<Sprite>();

        guyLeft.setScreenPosition((int) camera.pixelWidth / 2 - guyLeft.PixelWidth() + guyCenterOffset,
                                     (int) camera.pixelHeight / 2 - guyLeft.PixelHeight() / 2);
        guyRight.setScreenPosition((int) camera.pixelWidth / 2 + guyCenterOffset,
                                      (int) camera.pixelHeight / 2 - guyRight.PixelHeight() / 2);
        guyLeftInitialPosition = guyLeft.getScreenPosition();
        guyRightInitialPosition = guyRight.getScreenPosition();

        eyes = resourceFactory.Create(this, "EyesOpening");
        eyes.GetComponent<Sprite>().setWorldPosition(-5.5f, 36.5f, -1f);
    }
Example #3
0
    public void addPerson()
    {
        guyLeft = spriteRenderer.add(new Sprite(), this.GetType(), "guy1-fixed");
        guyRight = spriteRenderer.add(new Sprite(), this.GetType(), "guy2-fixed");

        guyLeft.setScreenPosition((int) camera.pixelWidth / 2 - guyLeft.PixelWidth() + guyCenterOffset,
                                     (int) camera.pixelHeight / 2 - guyLeft.PixelHeight() / 2);
        guyLeft.setDepth(-2);
        guyRight.setScreenPosition((int) camera.pixelWidth / 2 + guyCenterOffset,
                                      (int) camera.pixelHeight / 2 - guyRight.PixelHeight() / 2);
        guyRight.setDepth(-2);
        guyLeftInitialPosition = guyLeft.getScreenPosition();
        guyRightInitialPosition = guyRight.getScreenPosition();

        eyes = spriteRenderer.add(new Sprite(), this.GetType(), "eyes1", "eyes2");
        eyes.setScreenPosition(232f, 89f);
        eyes.setDepth(-3);
    }