Esempio n. 1
0
        public static HUDButton CreateIconClickButton(HUDShape shape,
                                                      float fHUDRadius, float fAngleHorz, float fAngleVert,
                                                      string icon,
                                                      IGameObjectGenerator addGeometry = null)
        {
            Material  mat    = MaterialUtil.CreateTransparentImageMaterial(icon);
            HUDButton button = new HUDButton()
            {
                Shape = shape
            };

            button.Create(mat);
            if (addGeometry != null)
            {
                button.AddVisualElements(addGeometry.Generate(), true);
            }
            HUDUtil.PlaceInSphere(button, fHUDRadius, fAngleHorz, fAngleVert);
            return(button);
        }
Esempio n. 2
0
        public static HUDButton CreateMeshClickButton(
            Mesh mesh, Color color, float fMeshScale, Quaternion meshRotation,
            HUDSurface hudSurf, float dx, float dy,
            IGameObjectGenerator addGeometry = null)
        {
            Material mat = (color.a < 1.0f) ?
                           MaterialUtil.CreateTransparentMaterial(color, color.a) :
                           MaterialUtil.CreateStandardMaterial(color);

            HUDButton button = new HUDButton();

            button.Create(mesh, mat, fMeshScale, meshRotation);

            if (addGeometry != null)
            {
                button.AddVisualElements(addGeometry.Generate(), true);
            }
            hudSurf.Place(button, dx, dy);
            return(button);
        }
Esempio n. 3
0
        public static HUDButton CreateMeshClickButton(
            Mesh mesh, Color color, float fMeshScale, Quaternion meshRotation,
            float fHUDRadius, float fAngleHorz, float fAngleVert,
            IGameObjectGenerator addGeometry = null)
        {
            Material mat = (color.a < 1.0f) ?
                           MaterialUtil.CreateTransparentMaterial(color, color.a) :
                           MaterialUtil.CreateStandardMaterial(color);

            HUDButton button = new HUDButton();

            button.Create(mesh, mat, fMeshScale, meshRotation);

            if (addGeometry != null)
            {
                button.AddVisualElements(addGeometry.Generate(), true);
            }
            HUDUtil.PlaceInSphere(button, fHUDRadius, fAngleHorz, fAngleVert);
            return(button);
        }
Esempio n. 4
0
        public static HUDButton CreateGeometryIconClickButton(HUDShape shape,
                                                              float fHUDRadius, float fAngleHorz, float fAngleVert,
                                                              Color bgColor,
                                                              IGameObjectGenerator addGeometry = null)
        {
            Material mat = (bgColor.a == 1.0f) ?
                           MaterialUtil.CreateStandardMaterial(bgColor) : MaterialUtil.CreateTransparentMaterial(bgColor);
            HUDButton button = new HUDButton()
            {
                Shape = shape
            };

            button.Create(mat);
            if (addGeometry != null)
            {
                button.AddVisualElements(addGeometry.Generate(), true);
            }
            HUDUtil.PlaceInSphere(button, fHUDRadius, fAngleHorz, fAngleVert);
            return(button);
        }