SFML community forums

Help => General => Topic started by: Sparcsky on June 21, 2017, 05:46:11 am

Title: Hard Coding Value of Sprite's Position
Post by: Sparcsky on June 21, 2017, 05:46:11 am
If I hard code the value of Sprite's position, will the sprite's position change if the program is used in a different device?

I wonder if stays the same or the program will stretch the sprite depending on the size of the device.  Mostly in my code, I position all my sprite with absolute value. Is it okay to hard code the value of sprite position?
 
Title: Re: Hard Coding Value of Sprite's Position
Post by: smilesprower on July 08, 2017, 02:01:22 pm
If the sprites position and size are based on percentages of the screen size, they will be scaled/stretched accordingly on different devices.

Just be careful if the devices have different aspect ratios. 4:3 / 16:9 etc
This can cause a circle to turn into an oval.