qt in rect /4


[ Zettels Traum ] [ search / suche ]

von dp am 06.Maerz 97 um 01:31:41:

zu: Perlen aus dem Strom der Nachrichten im direct_L von Daniel am 22.Dezember 96 um 02:00:59:

Yep, Greg's suggestion is the onw I would go with. Try:

on makeQTRect inputRect, QTSprite

-- find the remainder and subtract it from the rightmost location in
the rect
set NewRightVal = the right of inputRect - ((the right of inputRect -
the left of inputRect) mod 4)

-- find the remainder and subtract it from the lowermost location in
the rect
set NewBottomVal = the bottom of inputRect - ((the bottom of
inputRect - the top of inputRect) mod 4)

spritebox QTSprite, the left of inputRect, the top of inputRect,
NewRightVal , NewBottomVal
--its not possible to set the properties of a Sprite rect directly.

end makeQTRect

on posQTSprite QTSprite
set QTLocH = the locH of sprite QTSprite
set QTLocV = the locV of sprite QTSprite
set the loc of sprite QTSprite to point(QTLocH - (QTLocH mod 4),
QTLocV - (QTLocV mod 4))
end posQTSprite


Hope that helps!

Edwin R. Bean



Dazu:























D. Plänitz