This content has been marked as final. Show 3 replies
What box type do you have on the text member? It needs to be fixed or scrolling in order to set the height.
If you just want to position the sprite you can just set the loc
psprite.loc = point( rectLeft, cVer )
and the height and width should be unchanged
I solved it.
I used adjustwidth in combination with fixedlinespace. For some reason the sprite.height equals 67 although the member.height is 53.
The fix was simple: I have to use the member.height property instead of the sprite height property.
I used rects instead of locs because I had to line out sprites with centered registration points.
thanks for you reply
It's also worth noting that a sprite's "rect" property can appear tobehave in a strange way: if you set, then check the rect before a stage update, the rect property will still have the old value, but the sprite's width, height & loc will have been adjusted to reflect the new rect value that you set.
A sprite's 'rect' property, when read, seems to always return the "previously drawn" version of the sprite on stage (i.e. its rect at the moment of the previous stage update), wheras loch, locv, width, height, relate to director's current knowledge of what the sprite ought to look like at the moment of the *next* stage update.
Fitting in to this, I see "setting the rect of a sprite" as a kind of alias or shortcut to setting the loch, locv, width and height
properties - which is why you see that if you set a sprite's rect, all those other 'live' properties are updated immediately, but the sprite's actual 'rect' property doesn't get updated until the sprite is redrawn.
I think this is a kind of confusing and unexpected behaviour when setting and then reading a property, but it does have some logic which can be useful once you understand what's going on.
To put it very simply:
* Reading the rect property will *always* give you the sprite's rect as it appeared at the last stage update.
* Setting a sprite's rect property to a given rect 'r' will actually adjust the sprite's loch, locv, width and height, so that its rect will become equal to 'r' *after* the next stage update.