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 Texture object 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 UIImage to 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 as UIImage get cached and you should be handlin the caching of these Texture objects manually.

  • Declaration

    Swift

    public convenience init(named: String)

    Parameters

    named

    The name of the texture to be used.

    Return Value

    A new instance of Texture.