move rotationPadding into KissExtendedSprite
This commit is contained in:
@@ -155,7 +155,6 @@
|
||||
(prop &mut :Map<Int,JigsawPiece> pieceData (new Map))
|
||||
(prop &mut :Map<Int,Array<KissExtendedSprite>> connectedPieces (new Map))
|
||||
(prop &mut :Map<KissExtendedSprite,Int> indexMap (new Map))
|
||||
(prop &mut :Map<KissExtendedSprite,FlxPoint> rotationPaddingMap (new Map))
|
||||
(prop &mut :Map<Int,KissExtendedSprite> spriteMap (new Map)) // Because rewardSprites will be re-ordered in depth handling, this is required
|
||||
|
||||
(prop &mut lastRewardFileIndex -1)
|
||||
@@ -313,13 +312,7 @@
|
||||
(FlxSpriteUtil.alphaMask s source.pixels mask.pixels)
|
||||
**(#when debug
|
||||
(kiss_flixel.SpriteTools.writeOnSprite "$i" 32 s (object x (Percent 0.5) y (Percent 0.5)) FlxColor.RED))
|
||||
(let [ow s.frameWidth
|
||||
oh s.frameHeight]
|
||||
(s.loadRotatedGraphic s.pixels 4 -1 /*false true*/)
|
||||
(let [nw s.frameWidth
|
||||
nh s.frameHeight]
|
||||
(dictSet rotationPaddingMap s (.scale (new FlxPoint (- nw ow) (- nh oh)) 0.5))))
|
||||
|
||||
(s.loadRotatedGraphic s.pixels 4 -1 /*false true*/)
|
||||
|
||||
(set s.cameras [pieceCamera])
|
||||
|
||||
@@ -436,7 +429,7 @@
|
||||
maxY (/ (apply max pointsY) ros)
|
||||
tlc (.add (new FlxPoint minX minY) ROT_PADDING ROT_PADDING)
|
||||
brc (.add (new FlxPoint maxX maxY) ROT_PADDING ROT_PADDING)
|
||||
rotationPadding (dictGet rotationPaddingMap s)
|
||||
rotationPadding (s.getRotationPadding)
|
||||
rect (.fromTwoPoints (new FlxRect) (tlc.addPoint rotationPadding) (brc.addPoint rotationPadding))
|
||||
originOffset (new FlxPoint (- s.origin.x rect.x) (- s.origin.y rect.y))
|
||||
rotated (rect.getRotatedBounds s.angle originOffset)]
|
||||
|
Reference in New Issue
Block a user