FlatRedBall.Camera.WorldYAt C# (CSharp) Method

WorldYAt() public method

public WorldYAt ( float zPosition, bool orthogonal, float orthogonalHeight, float screenY ) : float
zPosition float
orthogonal bool
orthogonalHeight float
screenY float
return float
        public float WorldYAt(float zPosition, bool orthogonal, float orthogonalHeight, float screenY)
        {
            float verticalPercentage = (screenY - this.DestinationRectangle.Top) / (float)this.DestinationRectangle.Height;

            if (!orthogonal)
            {
                float absoluteTop = this.AbsoluteTopYEdgeAt(zPosition);
                float height = this.RelativeYEdgeAt(zPosition) * 2;
                return absoluteTop - height * verticalPercentage;
            }
            else
            {
                float yDistanceFromEdge = verticalPercentage * orthogonalHeight;
                return (this.Y + orthogonalHeight / 2.0f - yDistanceFromEdge);
            }
        }

Same methods

Camera::WorldYAt ( float screenY, float zPosition ) : float
Camera::WorldYAt ( float screenY, float zPosition, Layer layer ) : float
Camera::WorldYAt ( float screenY, float zPosition, bool overridingOrthogonal, float overridingOrthogonalHeight ) : float