當前位置: 首頁>>代碼示例>>C#>>正文


C# BasicEffect.Clone方法代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.Graphics.BasicEffect.Clone方法的典型用法代碼示例。如果您正苦於以下問題:C# BasicEffect.Clone方法的具體用法?C# BasicEffect.Clone怎麽用?C# BasicEffect.Clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.Xna.Framework.Graphics.BasicEffect的用法示例。


在下文中一共展示了BasicEffect.Clone方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawWrapper

        public DrawWrapper(SpriteBatch batch, GraphicsDevice device, AssetManager assetsManager)
        {
            GlobalScale = 1f;

            spriteBatch = batch;
            graphicsDevice = device;
            deviceWidth = graphicsDevice.Viewport.Width;

            Assets = assetsManager;

            basicEffect = new BasicEffect(device)
            {
                VertexColorEnabled = true,
                World = Matrix.Identity,
                View = Matrix.Identity,
            };

            guiEffect = (BasicEffect) basicEffect.Clone();

            SetProjectionMatrix(standardWidth, standardHeight);
            ScreenSize = new Vector2(graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height);

            displayWidth = standardWidth;
            displayHeight = standardHeight;
        }
開發者ID:rubna,項目名稱:MetroidClone,代碼行數:25,代碼來源:DrawWrapper.cs

示例2: LoadModel

        public void LoadModel(ContentManager content, BasicEffect effect)
        {
            Model model = content.Load<Model>(MODEL_PATH);
            int i = 0;
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect currentEffect in mesh.Effects)
                    this.textures[i++] = currentEffect.Texture;

                foreach (ModelMeshPart meshPart in mesh.MeshParts)
                    meshPart.Effect = effect.Clone();
            }
            this.model = model;
        }
開發者ID:ajbowler,項目名稱:Asteroids,代碼行數:14,代碼來源:Skybox.cs

示例3: LoadModel

        public void LoadModel(ContentManager content, BasicEffect effect)
        {
            float radius = 0f;
            if (this.Type == PowerupType.Shield)
            {
                this.Model = content.Load<Model>(SHIELD_MODEL_PATH);
                this.Texture = content.Load<Texture2D>(SHIELD_TEXTURE_PATH);
            }
            else
            {
                this.Model = content.Load<Model>(SHRINK_MODEL_PATH);
                this.Texture = content.Load<Texture2D>(SHRINK_TEXTURE_PATH);
            }

            foreach (ModelMesh mesh in this.Model.Meshes)
            {
                radius = Math.Max(radius, mesh.BoundingSphere.Radius);

                foreach (BasicEffect currentEffect in mesh.Effects)
                    this.Texture = currentEffect.Texture;

                foreach (ModelMeshPart meshPart in mesh.MeshParts)
                    meshPart.Effect = effect.Clone();
            }
            this.BoundingSphere = new BoundingSphere(this.Position, radius * 300f);
        }
開發者ID:ajbowler,項目名稱:Asteroids,代碼行數:26,代碼來源:Powerup.cs

示例4: LoadModelAndTexture

        public void LoadModelAndTexture(ContentManager content, BasicEffect effect)
        {
            float radius = 0f;
            this.Model = content.Load<Model>(MODEL_PATH);
            foreach (ModelMesh mesh in this.Model.Meshes)
            {
                radius = Math.Max(radius, mesh.BoundingSphere.Radius);

                foreach (BasicEffect currentEffect in mesh.Effects)
                    this.Texture = currentEffect.Texture;

                foreach (ModelMeshPart meshPart in mesh.MeshParts)
                    meshPart.Effect = effect.Clone();
            }

            this.BoundingSphere = new BoundingSphere(this.Position, radius);
            this.Texture = content.Load<Texture2D>(TEXTURE_PATH);
        }
開發者ID:ajbowler,項目名稱:Asteroids,代碼行數:18,代碼來源:Spaceship.cs

示例5: LoadModel

        private Model LoadModel(ContentManager Content, String skyboxName, out Texture2D[] textures)
        {
            Effect effect = new BasicEffect(game.GraphicsDevice);
            Model newModel = Content.Load<Model>("Skyboxes/" + skyboxName+"/skybox");
            textures = new Texture2D[newModel.Meshes.Count];
            int i = 0;
            foreach (ModelMesh mesh in newModel.Meshes)
                foreach (BasicEffect currentEffect in mesh.Effects)
                    textures[i++] = currentEffect.Texture;

            foreach (ModelMesh mesh in newModel.Meshes)
                foreach (ModelMeshPart meshPart in mesh.MeshParts)
                    meshPart.Effect = effect.Clone();

            return newModel;
        }
開發者ID:ewencluley,項目名稱:Space1939,代碼行數:16,代碼來源:Skybox.cs


注:本文中的Microsoft.Xna.Framework.Graphics.BasicEffect.Clone方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。