[QUESTION] Sprites X / Y Coordinates question!

Discussion about Mods for Prison Architect

Moderator: NBJeff

Feisty
level0
Posts: 1
Joined: Fri Nov 29, 2013 4:35 pm

[QUESTION] Sprites X / Y Coordinates question!

Postby Feisty » Sun Aug 31, 2014 8:06 am

Could please someone explain me how i can find the x and y coordinate? I tried it with for example with irfanview but the coordinates at the picture are not the same as in materials.txt

for example:
(Sprite: http://abload.de/img/spritesblr38.png)

BEGIN Object
Name RawPotato
Width 1
Height 1
Toughness 1.0000
MaxStackSize 20
RenderDepth 1
Properties Material
BEGIN Sprite
x 0
y 0
w 2
h 2

RotateType 0
END
END

Why is this x/y 0/0 ? and why "w 2" / h2"

BEGIN Equipment
Name Trowel
Scale 0.800000
AttackPower 1.00000
RechargeTime 1.00000
Properties Tools
Properties Metal
BEGIN Sprite
x 8
y 0
w 2
h 2

END

and why is this x/y 8/0 ? Its so" far away" at the picture of the "raw potato". How many pixels are 1x ?

Hope someone can help me! Just want to understand why. :(
User avatar
knoest26
level5
level5
Posts: 1380
Joined: Thu Jul 11, 2013 6:55 pm
Location: The Netherlands
Contact:

Re: Sprites X / Y Coordinates question!

Postby knoest26 » Sun Aug 31, 2014 9:40 am

the x and y coordinates refer to the position of the equipment on the custom sprites.png file. The indicate the top left corner of the sprite. The w and h tell you the height and width of the sprite, meaning how far the sprite spans in the sprites.png
User avatar
Phraxas
level2
level2
Posts: 107
Joined: Sun Aug 31, 2014 12:10 am
Location: USA - PA

Re: Sprites X / Y Coordinates question!

Postby Phraxas » Sun Aug 31, 2014 5:37 pm

1x or 1y = 32 pixels.
MajorNono
level0
Posts: 2
Joined: Fri Apr 05, 2013 8:18 pm

Re: Sprites X / Y Coordinates question!

Postby MajorNono » Sun Aug 31, 2014 5:41 pm

Each unit appears to represent 32 pixels. You can verify this yourself by opening the sprite image in the editor of your choice, then enable the grid and set the grid spacing/distance to 32 x 32

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 21 guests