If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : We have got a new blog where we post some interesting SWF internals info.
List of issues#2506 coordinate system for images
Author:
3plus4i
3plus4iDate created:
Type: question
Visibility: Everybody
Assigned to:
State: closed 

How does the coordinate system, that FFDec shows for previews of shapes, sprites etc
actually work? I can't make sense of the relation between the coordinates shown for a
child, the coordinates it ends up on a parent sprite and the values in the matrix of the
PlaceObject2 tag. I would have assumed that the origin of the coordinate system is the
registration point, so if I place an object with translateX = -200 and translateY = -100,
the origin of the child would end up at -200,-100 in the coordinate system of the parent,
but that doesn't even come close to the actual position. Am I missing something?
Now that I took a closer look, the actual coordinates seem quite close to the values in
the matrix divided by 20. Same seems to be true for the bounding box of shapes. Is it
maybe just a bug?
If an example would be useful, I'm trying to work with the file I uploaded on issue #2380,
for this I've mostly been looking at sprite 51 frame 25.
At sprite 51, frame 25,
there is placed character 46 with matrix(873, -1054).
Sprite 46 has 1 frame with placed character 45 with matrix (0, 0).
Shape 45 is shape which leftmost point is placed at coordinates (-6034, 1037).
The coordinates of shape and matrix values are in twips. 1 twip = 20 pixels.
So if you go back to sprite 51, frame 25,
if you add coordinates (-6034 + 0 + 873, 1037 + 0 + -1054)
then you get (-5161, -17) twips, which is (-258.05, 0.85) in pixels.
That's the spot where shape 45 has its leftmost point in sprite 51, frame 25.
If you place sprite 51 somewhere with matrix (100,200),
then the shape 45 leftmost spot will be at (-5161 + 100, -17 + 200) twips = (-253.05,
9.15) pixels
shape45.png (78 KiB)
sprite51_frame25.png (83 KiB)State: new→opened
Oh, I had never heard of twips before. Now it all makes sense. Thank you very much!
You're welcome.
State: opened→closed
