Coding

 Reply to this postStart new topic

GTA San Andreas Scale

fastman92
post Nov 10 2010, 08:06 PM
Post #1


Trained Member

Posts: 77
Joined: 25-October 10



GTA SA Scale


I want to explain in this tutorial about scale used by GTA SA.
First of all you must know that GTA SA uses own scale independent of screen size. It is proportional to size of screen.
OK. We start. I`ll call pixels as pixels of normal screen scale and points of GTA SA scale.

I have a screen 1024 x 768.
So I have to check what pixel will be my exemplary 30th point of GTA SA scale. To do it I make a script that will create menu at 30th point.


I open this image with MS Paint and look what pixel starts position of menu on.
It is 48th pixel.

I know now that on my screen x 768:
30 points = 48 pixels

There is specified number of available points to use. How to calculate how many?
48 pixels / 30 points = 1.6 // 1 point is 1.6 pixel on my 768 screen
768 / 1.6 = 480 // Now I know how many are points to use. Last is 480

How to calculate:
- 40 points on 768 px screen. How many it will be pixels?
40 * (768 / 480) = 64
points * (screen_size / 480) = pixels
- 100 pixels on 1024 px screen. How many it will be points to type in CLEO script?
1100 / (768 / 480) = 62.5
pixels / (screen_size / 480) = points.

Now you can take screenshot of GTA SA and if you make CLEO mod that uses screen coordinates then simply calculate required point float to type. MSPaint + these calculations.

It is tested for X screen coord. I`ll test it for Y tomorrow, probably coefficient will be 640.
Go to the top of the page
 
+Quote Post
Deji
post Nov 10 2010, 08:28 PM
Post #2


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Okay, but why not just set the games resolution to 640x480 when taking the screenshot?

Then the exact coords in MS Paint or whatever will work.


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Nov 12 2010, 07:56 PM
Post #3


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



@fastman92
There is more easier way.
Open your screenshot in Photoshop, then resize it to 6400x4480
Then, open "Info" window (F8 or Window->Info)
Then, you'll see a little cross there (near X and Y position). Right Mouse Click there and select "pixels"

Then, put cursor anywhere (where you want) in your picture. And you'll see the coordinates. If it will be, for example,
X: 3400
y: 256
Then, you must write
... 340.0 25.6
Go to the top of the page
 
+Quote Post
fastman92
post Nov 15 2010, 07:51 PM
Post #4


Trained Member

Posts: 77
Joined: 25-October 10



GTA San Andreas Scale

For X below
pixels = points * (X_screen_size / 640)
points = pixels / (X_screen_size / 640)

For Y below:
pixels = points * (Y_screen_size / 480)
points = pixels / (Y_screen_size / 480)
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

5 User(s) are reading this topic (5 Guests and 0 Anonymous Users)
0 Members: