Texture
public class Texture
A Texture holds an image, essentially, to be applied to a SpriteNode.
Currently these are being loaded synchronously using MTKTextureLoader.
Seealso
TextureAtlas
-
Undocumented
Declaration
Swift
public class Texture -
Undocumented
Declaration
Swift
public class Texture -
Undocumented
Declaration
Swift
public class Texture -
Creates a new
Textureobject given a name of an image.Warning
not sure why but if you pass in an empty string it uses the last value used somehow I still need to figure this weirdness out.
discussion: This is loading a
UIImageto create a texture so passing it names from an xcasset will work. I’m not sure if there is a better way to do this asUIImageget cached and you should be handlin the caching of theseTextureobjects manually.Declaration
Swift
public convenience init(named: String)Parameters
namedThe name of the texture to be used.
Return Value
A new instance of
Texture.
Texture Class Reference