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

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -