HmdSprite
public class HmdSprite : Hashable
Class for creating sprites from an image. The sprites are meant to be rendered (OpenGl) in the HMD overlays.
-
true or false whether the sprite is visible.
Declaration
Swift
public var enable: Bool { get set }
-
The current position for the sprite (x,y coords. 0,0 is the lower left corner)
Declaration
Swift
public var currentPosition: CGPoint { get set }
-
The size of the sprite. This size is the real pixel size in the OpenGl context
Declaration
Swift
public var displaySize: CGSize { get }
-
Constructor for a sprite
Declaration
Swift
convenience public init?(imageName: String, scale: CGFloat = 1)
Parameters
imageName
The name of the image. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.
scale
scale factor for the sprite (default is 1)
Return Value
nil if the sprite can not be created
-
Constructor for a sprite
Declaration
Swift
convenience public init?(imageName: String, size: CGSize)
Parameters
imageName
The name of the image. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.
size
Size used to render the image (overrides the image’s size)
Return Value
nil if the sprite can not be created
-
Declaration
Swift
public static func == (lhs: HmdSprite, rhs: HmdSprite) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)