Skip to main content
Topic: OFFSET (Read 21238 times) previous topic - next topic

OFFSET

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

Re: OFFSET

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

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

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


Re: OFFSET

Reply #3
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.

Re: OFFSET

Reply #4
Odd, but true.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: OFFSET

Reply #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...


Re: OFFSET

Reply #6
Did you use negative offsets?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: OFFSET

Reply #7
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?


Re: OFFSET

Reply #9
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.

Re: OFFSET

Reply #10
@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.
  
***** PAK128 Dev Team - semi-retired*****

Re: OFFSET

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

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: OFFSET

Reply #12
@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?

Re: OFFSET

Reply #13
well, i do use makeobj49...

Re: OFFSET

Reply #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!

 

Re: OFFSET

Reply #15
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...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!


Re: OFFSET

Reply #17
These are "straight" ?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: OFFSET

Reply #18
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.

Re: OFFSET

Reply #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.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!