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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -