News:

SimuTranslator
Make Simutrans speak your language.

OFFSET

Started by Fabio, January 22, 2009, 10:13:31 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Fabio

I can't find any documentation on the use of y-offset (and x-offset) and i don't remember their usage in dat files. can anybody help me? thanks

Zeno

Usage (AFAIK) is like EmptyImage[SW]=PNG_NAME.ROW.COL,OFFSET_X,OFFSET_Y

Example:
EmptyImage[SW]=Airbus_A380.0.0,-48,-48

Edit: Btw I'm not sure of x and y order  :-\

VS

IIRC: First y, then x. Same with row/column - first y order (row), then column (x).

btw... http://graphics.simutrans.com/displayimage.php?pos=-165

IgorEliezer

#3
Quote from: VS on January 22, 2009, 10:31:51 AM
IIRC: First y, then x. Same with row/column - first y order (row), then column (x).

It's a slight commentary:

It's a bit odd you have (y,x) instead of (x,y) "to be exact math-wise". ;) ... unless we are considering we are working strictly in computation approach, not with trigonometry.

VS


Fabio

#5
WELL, for sure y offset is less troublesome, so it can be used more... this could be a reason...

thank you very much, guys!






EDIT:
Do offsets work also for ways and bridges? i tried, but it looks like it doesn't work...


VS

Did you use negative offsets?

Fabio

yep, i'm making the bridges 32 pixel higher, so that i can use also full width and some tile-high pillar ends. is it possible?

Frank


prissi

Indded y is first, since often you need only y-offset. Also in an intermediate version, no x but only y-offset was possible.

There are some constarins to offsets: -128<=Offset<127 Also I am not sure what will happen if Offset+w<0 or Offset+w>255.

DirrrtyDirk

@Frank:

From memory I'd say you switched x and -x ... but I'm not sure, and I have no time to check right now.

VS

If I am not mistaken, Zeno reported success when aligning with both offsets negative... but I may indeed be wrong!

Zeno

Quote from: DirrrtyDirk on January 22, 2009, 09:38:15 PM
@Frank:
From memory I'd say you switched x and -x ... but I'm not sure, and I have no time to check right now.
I also think it's switched.

All my A380 planes were coded with -y,-x (I think -48 both). Maybe you should check any of them to see if it's really centered as expected. But fairly, I don't remember :P

Edit:
Err... I suppose you use makeobj49. I remember it didn't work with previous versions, did it?

Fabio

well, i do use makeobj49...

Zeno

#14
Oooops... I'm doing a remake of my A380 planes... and it seems to be something strange behaviour with offsets... let's see:
1) I take a 128-4-tile template VS recommended to use as background.
2) I resize to 176 px, which is the size of the A380 pngs.
3) I center the planes on the 176-sized tiles.
4) DAT code is like this EmptyImage[SW]=newA380.0.0,-48,-48 for all views.
5) I get this:
Alignment image.
Results image.
What is happening to West-East alignment?


Edit: Now I know: y alignment seems not to be working in makeobj49. I get same result when I put 0px on y offset!
It's working ok. Try redownload makeobj. I was using a wrong (49 beta) version :o Redownloaded and corrected!

VS

Offsets are not the same for x and y.

dx = (a-b)/2
dy = (a-b)*3/4

And actual alignment may be still different...

Zeno

With x=(128-176)/2=-24 and y=(128-176)*3/4=-36 I get a misalignment in N-S directions :(

VS

These are "straight" ?

Zeno

#18
Quote from: VS on January 24, 2009, 08:09:48 PM
These are "straight" ?
Ups... I've messed up the models, sorry :(
I'm deleting all variants but one to make the tests, give me a minute.


Edit: Not in N-S but in E-W direction. I have a small displacement and appears below the runway line.

VS

#19
Arrrrrrgh! I was wrong, totally wrong. Offsets are x,y. Sorry. Or so I think now. I tested with a big rectangle and it appears to work with swapped offsets.

I apologize again to everyone who believed my instructions and couldn't get offsets to work.