Forum

> > CS2D > Mods > Knife skins bigger than 32x32
ForenübersichtCS2D-Übersicht Mods-ÜbersichtEinloggen, um zu antworten

Englisch Knife skins bigger than 32x32

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Knife skins bigger than 32x32

maharaja
User Off Offline

Zitieren
Hello

I got a question about knife skin resolution change. I wanted to create some 'high quality' knife skin, but i had to resize the knife.bmp to 64x64, and the question is:
What will be the 'hotspot' ( place where player holds the knife ). (x, y)

In basic 32x32 image its like 12x24, does in 64x64 it gona 'go' to 24x48.

( sorry for bad english... )

alt Re: Knife skins bigger than 32x32

Alistaire
User Off Offline

Zitieren
32x32 -> 64x64 is an increase by 32 in width and height. You only need the increase in width and height to know your new position, which should be half the increase to keep the sprite centered. Half of 32 is 16, so you add 16 to your current x position, and because 64x64 and 32x32 are both squares the increase in height is the same as width, you add 16 to your current y position too.

1
2
3
4
5
6
--(x, y) is position on canvas size w * h

x' = x + ( w - w' ) / 2
y' = y + ( h - h' ) / 2

--(x', y') is position on canvas size w' * h'
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Mods-ÜbersichtCS2D-ÜbersichtForenübersicht