How to scale a sprite proportionally by one axis - swift/spritekit -
i creating game requires sprite resized either x value or y value depending on sprite size. how can resize sprite either x value or y value yet have scale proportionally? appreciated!
proportional means percentage, example if want scale 10% on x, node.xscale += node.xscale * 0.1
if want scale proportionally based on original size only, need preserve original scale somehow
let dscalex = node.xscale * 0.1 ... node.xscale += dscale
Comments
Post a Comment