Tag Info

New answers tagged

0

Conceptually, games can adjust to screen resolutions by scaling UI elements. If you want to take the easy route and use Unity's UI, this can be done pretty easily with a Canvas Scaler. I don't think that SFML has a canvas scaler and a well-made one can get pretty involved. A simpler canvas scaler has a reference resolution which is used to build your UI ...


1

Yes, unity does make the calculations itself. Test case: Game Window -> select different resolutions and run the following code: private void Update() { if (Input.GetMouseButtonDown(0)) { firstTouchPos = Input.mousePosition; } else if (Input.GetMouseButtonUp(0)) { endTouchPos = ...


1

Click on the Title in your hierarchy. In the Rect transform, you can see that square in the editor. Click it, you can then set the position of the Text (Top, in you case.) After that, press Alt, and choose where to place your Anchor. (Top again). If you still don't like it, you can choose to move the Anchor manually in the Scene. Ultimately, keep the Anchor ...


2

When you resize your game resolution you need to update every single rectangle in your game (every button, etc) and multiply it by a proper scale, so that the "hitboxes" would work, which would be a lot of work. So, a smarter way of achieving the same result is simply by multiplying your mouse position by a Vector2 scale = new Vector2(originalWidth / width, ...


0

i have done like this to supprot multiple resolution............. my AppMacro.h #ifndef __APPMACROS_H__ #define __APPMACROS_H__ #include "cocos2d.h" #define DESIGN_RESOLUTION_480X320 0 #define DESIGN_RESOLUTION_480X320 1 #define DESIGN_RESOLUTION_1024X768 2 #define DESIGN_RESOLUTION_1280X800 3 #define DESIGN_RESOLUTION_2048X1536 4 /* If you ...



Top 50 recent answers are included