Exemplo n.º 1
0
        public void SetTextureInfo(UnifiedTextureInfo textureInfo)
        {
            texcoords[0] = textureInfo.u0;              // left top u
            texcoords[1] = textureInfo.v0;              // left top v

            texcoords[2] = textureInfo.u0;              // left bottom u
            texcoords[3] = textureInfo.v1;              // left bottom v

            texcoords[4] = textureInfo.u1;              // right top u
            texcoords[5] = textureInfo.v0;              // right top v

            texcoords[6] = textureInfo.u1;              // right bottom u
            texcoords[7] = textureInfo.v1;              // right bottom v


#if true
            _uv[0] = new Short2((short)(textureInfo.u0 * 32767), (short)(textureInfo.v0 * 32767));       //(0,0)
            _uv[1] = new Short2((short)(textureInfo.u0 * 32767), (short)(textureInfo.v1 * 32767));       //(1,0)
            _uv[2] = new Short2((short)(textureInfo.u1 * 32767), (short)(textureInfo.v0 * 32767));       //(0,1)
            _uv[3] = new Short2((short)(textureInfo.u1 * 32767), (short)(textureInfo.v1 * 32767));       //(1,1)
#else
            _uv[0] = new Short2((short)(textureInfo.u0 * 32767), (short)(textureInfo.v0 * 32767));
            _uv[1] = new Short2((short)(textureInfo.u1 * 32767), (short)(textureInfo.v0 * 32767));       //(1,0)
            _uv[2] = new Short2((short)(textureInfo.u0 * 32767), (short)(textureInfo.v1 * 32767));       //(0,1)
            _uv[3] = new Short2((short)(textureInfo.u1 * 32767), (short)(textureInfo.v1 * 32767));       //(1,1)
#endif

            this.width  = textureInfo.w;
            this.height = textureInfo.h;
        }
Exemplo n.º 2
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.º 3
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.º 4
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.º 5
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.º 6
0
        public void SetTextureInfo(UnifiedTextureInfo textureInfo)
        {
            texcoords[0] = textureInfo.u0;              // left top u
            texcoords[1] = textureInfo.v0;              // left top v

            texcoords[2] = textureInfo.u0;              // left bottom u
            texcoords[3] = textureInfo.v1;              // left bottom v

            texcoords[4] = textureInfo.u1;              // right top u
            texcoords[5] = textureInfo.v0;              // right top v

            texcoords[6] = textureInfo.u1;              // right bottom u
            texcoords[7] = textureInfo.v1;              // right bottom v

            this.width  = textureInfo.w;
            this.height = textureInfo.h;
        }
Exemplo n.º 7
0
 public SpriteB(UnifiedTextureInfo textureInfo)
 {
     this.SetTextureInfo(textureInfo);
 }
Exemplo n.º 8
0
        public void SetTextureInfo(UnifiedTextureInfo textureInfo)
        {
            texcoords[0] = textureInfo.u0;	// left top u
            texcoords[1] = textureInfo.v0;	// left top v

            texcoords[2] = textureInfo.u0;	// left bottom u
            texcoords[3] = textureInfo.v1;	// left bottom v

            texcoords[4] = textureInfo.u1;	// right top u
            texcoords[5] = textureInfo.v0;	// right top v

            texcoords[6] = textureInfo.u1;	// right bottom u
            texcoords[7] = textureInfo.v1;	// right bottom v

            this.width = textureInfo.w;
            this.height = textureInfo.h;
        }
Exemplo n.º 9
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.º 10
0
 public SpriteB(UnifiedTextureInfo textureInfo)
 {
     this.SetTextureInfo(textureInfo);
 }
Exemplo n.º 11
0
        /// 開始
        public override bool DoStart()
        {
            Data.ModelDataManager   	  resMgr = Data.ModelDataManager.GetInstance();

            textureInfo = resMgr.SetTexture2((int)Data.Tex2dResId.BossWall);
            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.º 12
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.º 13
0
        public void SetTextureInfo(UnifiedTextureInfo textureInfo)
        {
            texcoords[0] = textureInfo.u0;	// left top u
            texcoords[1] = textureInfo.v0;	// left top v

            texcoords[2] = textureInfo.u0;	// left bottom u
            texcoords[3] = textureInfo.v1;	// left bottom v

            texcoords[4] = textureInfo.u1;	// right top u
            texcoords[5] = textureInfo.v0;	// right top v

            texcoords[6] = textureInfo.u1;	// right bottom u
            texcoords[7] = textureInfo.v1;	// right bottom v

            #if true
            _uv[0] = new Short2((short)(textureInfo.u0*32767),(short)(textureInfo.v0*32767));//(0,0)
            _uv[1] = new Short2((short)(textureInfo.u0*32767),(short)(textureInfo.v1*32767));//(1,0)
            _uv[2] = new Short2((short)(textureInfo.u1*32767),(short)(textureInfo.v0*32767));//(0,1)
            _uv[3] = new Short2((short)(textureInfo.u1*32767),(short)(textureInfo.v1*32767));//(1,1)
            #else
            _uv[0] = new Short2((short)(textureInfo.u0*32767),(short)(textureInfo.v0*32767));
            _uv[1] = new Short2((short)(textureInfo.u1*32767),(short)(textureInfo.v0*32767));//(1,0)
            _uv[2] = new Short2((short)(textureInfo.u0*32767),(short)(textureInfo.v1*32767));//(0,1)
            _uv[3] = new Short2((short)(textureInfo.u1*32767),(short)(textureInfo.v1*32767));//(1,1)
            #endif

            this.width = textureInfo.w;
            this.height = textureInfo.h;
        }
Exemplo n.º 14
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(TexId+(int)Data.Tex2dResId.HouseStart);
            float r = textureInfo.w;
            float b = textureInfo.h;
            // 		scale = 1/(float)texture.Height;
             		scale = 0.05f;
            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.º 15
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.º 16
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.º 17
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;
        }