Search Unity

Camera for mobile 2D game with fixed background

Discussion in '2D' started by Tosek, Sep 19, 2017.

  1. Tosek

    Tosek

    Joined:
    Apr 28, 2015
    Posts:
    3
    Hi there, I am new to unity and did not find the exact solution for my problem in this forum by searching, so I am asking this in a new thread.

    I am creating a "match 3" 2D game for mobile devices.
    All sprites (the game pieces) are created with 128x128 pixels.
    The background picture is created with a size of 1920x1080.

    I want to set the background in that way, that it fills the complete screen and all the sprites should have the size exactly referring to the background. So 15 sprites (1920/128) should have space horizontally on the screen.

    This should be the same for all devices, even if the whole scene must be streched to another aspect ration or relosution for a specific device. The UI controls should use the unity relative UI system, so they are not on my focus now.

    Which parameters do I have to set for my camera setup (size etc.) and for the sprites (pixel per unit etc.)?

    Can you give me some hints about that?

    (I have done a libgdx game earlier and libgdx scaled averything based on a virtual reference relosution to the device screen even if it was streched more into x or y direction)

    Thanks in advance for your help

    -Torsten