Exemplo n.º 1
0
        public bool startforChange(int texnumber)
        {
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();

            spriteShader = new ShaderProgram("/Application/shaders/Texture2.cgx");
            textureInfo  = resMgr.SetTexture2(texnumber);

            float r = textureInfo.w;
            float b = textureInfo.h;

//		scale = 1/(float)texture.Height;
            vertices = new VertexBuffer(4, VertexFormat.Float3, VertexFormat.Float2);

            vertices.SetVertices(0, new float[] { 0, 0, 0,
                                                  r, 0, 0,
                                                  r, b, 0,
                                                  0, b, 0 });

            vertices.SetVertices(1, new float[] { textureInfo.u0, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v1,
                                                  textureInfo.u0, textureInfo.v1 });


            texCenter.X = textureInfo.w / 2;
            texCenter.Y = textureInfo.h / 2;

            DoUpdateMatrix();
            return(true);
        }
Exemplo n.º 2
0
        /// 開始
        public override bool DoStart()
        {
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();
            if (TexIdForText < (int)Data.Tex2dResId.NormalCharMax)
            {
                textureInfo = resMgr.SetTexture2(TexId + (int)Data.Tex2dResId.SpeechBalloon1);
                ObjTex.Start();
            }
            else if (TexIdForText == (int)Data.Tex2dResId.Zonbi1)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.SpeechBalloon3);
            }
            uvPos  = new Vector2(textureInfo.u0, textureInfo.v0);
            uvSize = new Vector2(textureInfo.u1 - textureInfo.u0, textureInfo.v1 - textureInfo.v0);
            if (TexIdForText < (int)Data.Tex2dResId.NormalCharMax)
            {
                texSize = new Vector2(textureInfo.w / 10 * ObjTex.scaleX, textureInfo.h / 10);
            }
            else if (TexIdForText == (int)Data.Tex2dResId.Zonbi1)
            {
                texSize = new Vector2(textureInfo.w / 10, textureInfo.h / 10);
            }

            DoUpdateMatrix();
            return(true);
        }
Exemplo n.º 3
0
        /// 開始
        public override bool DoStart()
        {
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();

            spriteShader = new ShaderProgram("/Application/shaders/Texture2.cgx");
            textureInfo  = resMgr.SetTexture2((int)Data.Tex2dResId.Gareki);

            float r = textureInfo.w;
            float b = textureInfo.h;

            scale    = 1 / (float)textureInfo.h;
            vertices = new VertexBuffer(4, VertexFormat.Float3, VertexFormat.Float2);

            vertices.SetVertices(0, new float[] { 0, 0, 0,
                                                  r, 0, 0,
                                                  r, b, 0,
                                                  0, b, 0 });

            vertices.SetVertices(1, new float[] { textureInfo.u0, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v1,
                                                  textureInfo.u0, textureInfo.v1 });



            texCenter.X = textureInfo.w / 2;
            texCenter.Y = textureInfo.h / 2;

            DoUpdateMatrix();
            return(true);
        }
Exemplo n.º 4
0
        /// 開始
        public override bool DoStart()
        {
//			"/Application/res/data/2D/" + dataList.TexFileNameList[mdlTexId,i]
//		Data.ModelDataManager    resMgr = Data.ModelDataManager.GetInstance();
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();

            spriteShader = new ShaderProgram("/Application/shaders/Texture2.cgx");
            textureInfo  = resMgr.SetTexture2((int)Data.Tex2dResId.MakingWall1);


            float r = textureInfo.w;
            float b = textureInfo.h;

//      scale = 1/(float)texture.Height;
            vertices = new VertexBuffer(4, VertexFormat.Float3, VertexFormat.Float2);

            vertices.SetVertices(0, new float[] { 0, 0, 0,
                                                  r, 0, 0,
                                                  r, b, 0,
                                                  0, b, 0 });

            vertices.SetVertices(1, new float[] { textureInfo.u0, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v1,
                                                  textureInfo.u0, textureInfo.v1 });

            texCenter.X = textureInfo.w / 2;
            texCenter.Y = textureInfo.h / 2;

            DoUpdateMatrix();
            return(true);
        }
Exemplo n.º 5
0
        /// 開始
        public override bool DoStart()
        {
//			"/Application/res/data/2D/" + dataList.TexFileNameList[mdlTexId,i]
//		Data.ModelDataManager    resMgr = Data.ModelDataManager.GetInstance();
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();
            if (TexId == 0)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Noumin1);
            }
            else if (TexId == 1)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Senshi1);
            }
            else if (TexId == 2)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Souryo1);
            }
            else if (TexId == 3)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Zonbi1);
            }
            else if (TexId == 4)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Necromancer1);
            }

            uvPos   = new Vector2(textureInfo.u0, textureInfo.v0);
            uvSize  = new Vector2(textureInfo.u1 - textureInfo.u0, textureInfo.v1 - textureInfo.v0);
            texSize = new Vector2(textureInfo.w / 10, textureInfo.h / 10);

            DoUpdateMatrix();
            return(true);
        }
Exemplo n.º 6
0
        public Hp2dTex(int Id, float posX, float posY, float speed)
        {
            this.Id = Id;
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();
            if (Id == (int)Data.Tex2dResId.TowerStart)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Bosstower);
            }
            else if (Id == (int)Data.Tex2dResId.HouseStart)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.BossMonument);
            }
            else if (Id == (int)Data.Tex2dResId.WallStart)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.BossWall);
            }
            else
            {
                textureInfo = resMgr.SetTexture2((int)Id);
            }

            uvPos   = new Vector2(textureInfo.u0, textureInfo.v0);
            uvSize  = new Vector2(textureInfo.u1 - textureInfo.u0, textureInfo.v1 - textureInfo.v0);
            texSize = new Vector2(textureInfo.w, textureInfo.h) * 1.5f;

            //randomにする
            rotate      = StaticDataList.getRandom(0, 360);
            rotatespeed = StaticDataList.getRandom(3, 6) / 100.0f;
            Pos.X       = posX;
            Pos.Y       = posY;
            this.speed  = speed;
            deadFlag    = false;
        }
Exemplo n.º 7
0
        public void changeTex(int Id)
        {
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();
            textureInfo = resMgr.SetTexture2(Id);

            uvPos   = new Vector2(textureInfo.u0, textureInfo.v0);
            uvSize  = new Vector2(textureInfo.u1 - textureInfo.u0, textureInfo.v1 - textureInfo.v0);
            texSize = new Vector2(textureInfo.w / 10, textureInfo.h / 10);
        }
Exemplo n.º 8
0
 public void Init()
 {
     Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();
     textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Uppertooth);
     uvPos       = new Vector2(textureInfo.u0, textureInfo.v0);
     uvSize      = new Vector2(textureInfo.u1 - textureInfo.u0, textureInfo.v1 - textureInfo.v0);
     texSize     = new Vector2(textureInfo.w, textureInfo.h) * 8.0f;
     Pos.X       = 450;
     Pos.Y       = -200;
 }
Exemplo n.º 9
0
        /// 開始
        public override bool DoStart()
        {
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();

            textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Bosstower);
            uvPos       = new Vector2(textureInfo.u0, textureInfo.v0);
            uvSize      = new Vector2(textureInfo.u1 - textureInfo.u0, textureInfo.v1 - textureInfo.v0);
            texSize     = new Vector2(textureInfo.w / 10, textureInfo.h / 10);

            DoUpdateMatrix();
            return(true);
        }
Exemplo n.º 10
0
        public void Init()
        {
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();
            textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.Life);
            uvPos       = new Vector2(textureInfo.u0, textureInfo.v0);
            uvSize      = new Vector2(textureInfo.u1 - textureInfo.u0, textureInfo.v1 - textureInfo.v0);
            texSize     = new Vector2(textureInfo.w, textureInfo.h) * 1.55f;

            /*
             * rot.X = 0.0f;
             * rot.Y = 0.0f;
             * rot.Z = 0.0f;
             */
            Pos.X = 125;
            Pos.Y = 60;
        }
Exemplo n.º 11
0
        /// 開始
        public override bool DoStart()
        {
            Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance();
            spriteShader = new ShaderProgram("/Application/shaders/Texture2.cgx");
            if (TexIdForText < 3)
            {
                textureInfo = resMgr.SetTexture2(TexId + (int)Data.Tex2dResId.SpeechBalloon1);
            }
            else if (TexIdForText == 3)
            {
                textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.SpeechBalloon3);
            }

            float r = textureInfo.w;
            float b = textureInfo.h;

            vertices = new VertexBuffer(4, VertexFormat.Float3, VertexFormat.Float2);

            vertices.SetVertices(0, new float[] { 0, 0, 0,
                                                  r, 0, 0,
                                                  r, b, 0,
                                                  0, b, 0 });

            vertices.SetVertices(1, new float[] { textureInfo.u0, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v0,
                                                  textureInfo.u1, textureInfo.v1,
                                                  textureInfo.u0, textureInfo.v1 });

            texCenter.X = textureInfo.w / 2;
            texCenter.Y = textureInfo.h / 2;
            if (TexIdForText < 3)
            {
                ObjTex.Start();
            }
            DoUpdateMatrix();
            return(true);
        }