I tried to set the size SKSpriteNodefrom a PNG image (OK with this, just a:
SKSpriteNode
test = SKSpriteNode(imageNamed: "myImage")
But when it comes to changing it, I'm not sure what I should use test.setScaleor test.size. What is the difference and when should I use each of them?
test.setScale
test.size
setScale():
setScale()
Sets the xScale and yScale node properties . These two parameters are the scaling factor that multiplies the width (for xScale) and height (for yScale) of the node and its children.
Code example:
spaceship.setScale(0.50) // decreased scale to it half size
size(): ( ) .
size()
:
spaceship.size = CGSizeMake(100.0, 70.0) // Re-size the dimensions to these values
setScale size?
setScale
size
setScale , , , SKAction.scaleTo, .
SKAction.scaleTo
size , , .
spriteNode, .setScale .xScale .yScale, ..size UIKit.
, , 2x :
theNode.xScale = 2.0 theNode.yScale = 2.0
, float,
, ,.setScale - , .size - , , .. , , .setScale. , .size.
, , , - . !
, SKSpriteNode , node.
node () node, , node, ().
node , .
. , , , 1.0 - scaleTo scaleBy .
.size, , node .setScale/.xScale/. yScale. node, physicsBody.
.size
.setScale
.xScale
yScale
physicsBody
Source: https://habr.com/ru/post/1649556/More articles:Combining datasets by date range and categorical variable - performancecom.querydsl.core.types.Predicate symbol not found after upgrading to Spring boot 1.4.0 - spring-boot@SessionScoped CDI bean is another instance when injected - javabeansПример для входа в CDI-SessionScoped Logon с TomEE - sessionuse postman to access Firebase REST API - restReplacing a type inside a tuple in C ++ 11 - c ++Elixir: use a macro in the body of the same module that defined it - macrosPut promises in order - javascriptGrouping Unique Identification Pairs Using R - rКакой тип "type()" в Rust? - rustAll Articles