Exemple #1
0
        private ObjHudPanel CreateHudPanel(Size tempSize, Color aColor, ObjHudPanel.Anchors anAnchor)
        {
//            Vector2 tempLoc2 = new Vector2(0, 0);
//
//            SolidBrush tempBrush = new SolidBrush(aColor);
//            Bitmap tempBmp = BitmapHelper.CreatBitamp(new Size(20, 20), tempBrush);
//            ObjMaterial tempMaterial = new ObjMaterial(hudProgram) {DiffuseMap = new Texture(tempBmp)};
            ObjMaterial tempMaterial = TheResourceManager.GetPlainColor(hudProgram, "HudPanelPlain" + aColor.Name,
                                                                        aColor);
            Vector2 tempLoc2 = new Vector2(0, 0);

            ObjHudPanel tempObjObject2 =
                new ObjHudPanel(ObjectPrimitives.CreateSquareWithNormalsYorZ(new Vector3(0, 0, 0),
                                                                             new Vector3(tempSize.Width,
                                                                                         tempSize.Height,
                                                                                         0), true))
            {
                Anchor   = anAnchor,
                Position =
                    tempLoc2,
                Size = tempSize
            };

            tempObjObject2.Size = tempSize;
            tempObjObject2.UpdatePosition(Width, Height);
            tempObjObject2.Material = tempMaterial;
            return(tempObjObject2);
        }
Exemple #2
0
        private ObjHudPanel CreateHudPanel(string aBmpPath, ObjHudPanel.Anchors anAnchor)
        {
            ObjMaterial tempMaterial = TheResourceManager.GetFromFile(hudProgram, aBmpPath);
            Size        tempSize     = tempMaterial.DiffuseMap.Size;

            Vector2 tempLoc2 = new Vector2(0, 0);

            ObjHudPanel tempObjObject2 =
                new ObjHudPanel(ObjectPrimitives.CreateSquareWithNormalsYorZ(new Vector3(0, 0, 0),
                                                                             new Vector3(tempSize.Width,
                                                                                         tempSize.Height,
                                                                                         0), true))
            {
                Anchor   = anAnchor,
                Position =
                    tempLoc2,
                Size = tempSize
            };

            tempObjObject2.Size = tempSize;
            tempObjObject2.UpdatePosition(Width, Height);
            tempObjObject2.Material = tempMaterial;
            return(tempObjObject2);
        }