AnchorPoint

public enum AnchorPoint

An AnchorPoint is a point that binds a 2D object into a 3D scene. If you were to draw a ray from the camera into the scene, the anchor point would be the position through the texture (in 2D)

  • The center of the Overlay

    ┌───────┐
           
          
           
    └───────┘
    

    Declaration

    Swift

    case center
  • top

    The top of the Overlay, in the middle

    ┌───╳───┐
           
           
           
    └───────┘
    

    Declaration

    Swift

    case top
  • The top right of the Overlay

    ┌───────╳
           
           
           
    └───────┘
    

    Declaration

    Swift

    case topRight
  • The top left of the Overlay

    ╳───────┐
           
           
           
    └───────┘
    

    Declaration

    Swift

    case topLeft
  • The left side of the Overlay, in the middle

    ┌───────┐
           
           
           
    └───────┘
    

    Declaration

    Swift

    case left
  • The right side of the Overlay, in the middle

    ┌───────┐
           
           
           
    └───────┘
    

    Declaration

    Swift

    case right
  • The bottom side of the Overlay, in the middle

    ┌───────┐
           
           
           
    └───╳───┘
    

    Declaration

    Swift

    case bottom
  • The bottom left of the Overlay

    ┌───────┐
           
           
           
    ╳───────┘
    

    Declaration

    Swift

    case bottomLeft
  • The bottom right of the Overlay

    ┌───────┐
           
           
           
    └───────╳
    

    Declaration

    Swift

    case bottomRight
  • A custom anchor point, x & y are always in the domain 0 -> 1. If your image with a resolution (800, 600) an anchor point of (0.25, 0.25) would align the point 200, 150 in the image.

    Declaration

    Swift

    case custom(x: Float, y: Float)
  • Return an offset which is used to define a point

    Declaration

    Swift

    public func toTextureOffset() -> (x: Float, y: Float)