/// レイアウト&2D素材の読み込み public bool Load() { image = new Texture2D("/Application/res/data/2D/2d_01.png", false); TitleImage = new Texture2D("Application/res/data/2Dtex/Title.png", false); spritList = new DemoGame.Sprite[lytScrData.Length / 2]; for (int i = 0; i < lytScrData.Length / 2; i++) { int scrX = lytScrData[i * 2 + 0]; int scrY = lytScrData[i * 2 + 1]; int rectX = lytRectData[i * 4 + 0]; int rectY = lytRectData[i * 4 + 1]; int rectW = lytRectData[i * 4 + 2]; int rectH = lytRectData[i * 4 + 3]; if (i < (int)SpriteId.Life || i >= (int)SpriteId.Play_on) { scrX += offsetW; scrY += offsetH; } spritList[i] = new DemoGame.Sprite(image, rectX, rectY, rectW, rectH, scrX, scrY); } TitleSprite = new DemoGame.Sprite(TitleImage, 0.0f, 0.0f, 0.0f, 1.0f); for (int i = 0; i < spritList.Length; i++) { DemoGame.Graphics2D.AddSprite(spritList[spritList.Length - 1 - i]); } ClearSpriteAll(); return(true); }
public void Term() { uppertoothimage.Dispose(); undertoothimage.Dispose(); LifeGauge.Dispose(); spritundertooth = null; sprituppertooth = null; spritLifeGauge = null; }
public void Init() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; uppertoothimage = new Texture2D("/Application/res/data/2Dtex/uppertooth.png", false ); undertoothimage = new Texture2D("/Application/res/data/2Dtex/undertooth.png", false ); LifeGauge = new Texture2D("/Application/res/data/2Dtex/Life_Gauge.png", false ); sprituppertooth = new DemoGame.Sprite(uppertoothimage , 0.0f,0.0f,0.0f,8.0f); spritundertooth = new DemoGame.Sprite(undertoothimage , 0.0f,0.0f,0.0f,8.0f); spritLifeGauge = new DemoGame.Sprite(LifeGauge , 0.0f,0.0f,0.0f,1.5f); }
public void Init() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; uppertoothimage = new Texture2D("/Application/res/data/2Dtex/uppertooth.png", false); undertoothimage = new Texture2D("/Application/res/data/2Dtex/undertooth.png", false); LifeGauge = new Texture2D("/Application/res/data/2Dtex/Life_Gauge.png", false); sprituppertooth = new DemoGame.Sprite(uppertoothimage, 0.0f, 0.0f, 0.0f, 8.0f); spritundertooth = new DemoGame.Sprite(undertoothimage, 0.0f, 0.0f, 0.0f, 8.0f); spritLifeGauge = new DemoGame.Sprite(LifeGauge, 0.0f, 0.0f, 0.0f, 1.5f); }
/// レイアウト&2D素材の読み込み public bool Load() { image = new Texture2D( "/Application/res/data/2D/2d_01.png", false); TitleImage = new Texture2D("Application/res/data/2Dtex/Title.png",false); spritList = new DemoGame.Sprite[lytScrData.Length/2]; for( int i=0; i<lytScrData.Length/2; i++ ){ int scrX = lytScrData[i*2+0]; int scrY = lytScrData[i*2+1]; int rectX = lytRectData[i*4+0]; int rectY = lytRectData[i*4+1]; int rectW = lytRectData[i*4+2]; int rectH = lytRectData[i*4+3]; if( i < (int)SpriteId.Life || i >= (int)SpriteId.Play_on ){ scrX += offsetW; scrY += offsetH; } spritList[i] = new DemoGame.Sprite( image, rectX, rectY, rectW, rectH, scrX, scrY ); } TitleSprite = new DemoGame.Sprite(TitleImage , 0.0f, 0.0f, 0.0f, 1.0f); for( int i=0; i<spritList.Length; i++ ){ DemoGame.Graphics2D.AddSprite( spritList[spritList.Length-1-i] ); } ClearSpriteAll(); return true; }