public void RenderTitle(int Fadecount) { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; DemoGame.Graphics2D.DrawSprite(TitleSprite, useGraphDev.DisplayWidth / 2 - TitleImage.Width / 2, 0, (20 - Fadecount) / 20.0f); string TapInput = "Tap To Start"; int strW = DemoGame.Graphics2D.CurrentFont.GetTextWidth(TapInput); int strH = DemoGame.Graphics2D.CurrentFont.Size; DemoGame.Graphics2D.FillRect(((UInt32)(0x80 * (20 - Fadecount) / 20.0f) << 24), 0, useGraphDev.DisplayHeight / 2 - strH / 2 - 5 + 150, useGraphDev.DisplayWidth, strH + 10); DemoGame.Graphics2D.AddSprite("Mess", TapInput, 0xffffffff, useGraphDev.DisplayWidth / 2 - strW / 2, useGraphDev.DisplayHeight / 2 - strH / 2 + 150); DemoGame.Graphics2D.DrawSpritesUseAlpha(); }
/// private メソッド ///--------------------------------------------------------------------------- /// デバック用 ///--------------------------------------------------------------------------- /// デバック用:描画 public void Draw(DemoGame.GraphicsDevice graphDev, int hitIdx, Rgba color1, Rgba color2) { DemoGame.RenderGeometry drawSph = new DemoGame.RenderGeometry(); drawSph.MakeSphere(); DemoGame.Camera camera = graphDev.GetCurrentCamera(); if (hitIdx < 0) { drawSph.DrawSphere(graphDev.Graphics, this.Sphre, camera, color1); } else { drawSph.DrawSphere(graphDev.Graphics, this.Sphre, camera, color2); } drawSph = null; }
public bool renderEffCheck() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; DemoGame.Graphics2D.FillRect(0x80000000, 0, 0, 300, 100); DemoGame.Graphics2D.AddSprite("Mess", "EffectTest", 0xff40ff40, 2, 2); DemoGame.Graphics2D.AddSprite("Mess1", "Eff " + effNo, 0xffff0040, 30, 50 + 0 * 28); DemoGame.Graphics2D.DrawSprites(); useGraphDev.Graphics.SwapBuffers(); DemoGame.Graphics2D.RemoveSprite("Mess"); DemoGame.Graphics2D.RemoveSprite("Mess1"); return(true); }
/// 描画処理 public bool Render() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; useGraphDev.Graphics.SetClearColor(0.5f, 0.5f, 0.5f, 0.0f); useGraphDev.Graphics.Clear(); ctrlResMgr.Draw(); /// レイアウトの描画 AppLyout.GetInstance().Render(); AppDispEff.GetInstance().Draw(useGraphDev); useGraphDev.Graphics.SwapBuffers(); return(true); }
/// 描画処理 public bool Render() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; useGraphDev.Graphics.SetClearColor(0.0f, 0.025f, 0.25f, 0.0f); useGraphDev.Graphics.Clear(); DemoGame.Graphics2D.RemoveSprite("mess"); DemoGame.Graphics2D.AddSprite("mess", " Now Loading ...", 0xffffffff, 20, 120); DemoGame.Graphics2D.DrawSprites(); AppDispEff.GetInstance().Draw(useGraphDev); useGraphDev.Graphics.SwapBuffers(); DemoGame.Graphics2D.RemoveSprite("mess"); return(true); }
/// デバック用 ///--------------------------------------------------------------------------- /// デバック用:描画 public void Draw(DemoGame.GraphicsDevice graphDev, int hitIdx, Rgba color1, Rgba color2) { DemoGame.RenderGeometry drawTri = new DemoGame.RenderGeometry(); drawTri.MakeTriangle(); DemoGame.Camera camera = graphDev.GetCurrentCamera(); for (int i = 0; i < EntryNum; i++) { if (i != hitIdx) { drawTri.DrawTriangle(graphDev.Graphics, Triangle[i], camera, color1); } else { drawTri.DrawTriangle(graphDev.Graphics, Triangle[i], camera, color2); } } drawTri = null; }
public bool renderFixEntry() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; DemoGame.Graphics2D.FillRect(0x80000000, 0, 0, useGraphDev.DisplayWidth, useGraphDev.DisplayHeight); DemoGame.Graphics2D.RemoveSprite("Mess"); DemoGame.Graphics2D.AddSprite("Mess", "Entry Fixture", 0xff40ff40, 2, 2); DemoGame.Graphics2D.DrawSprites(); for (int i = 0; i < fixEntryStringList.Length; i++) { string str = String.Format("{0:D2} : " + fixEntryStringList[i], i); int x = (i < 12)? 30 : 300; int y = (i < 12)? (50 + i * 28) : (50 + (i - 12) * 28); if (enemyId == i) { DemoGame.Graphics2D.AddSprite("Mess" + i, str, 0xffff0000, x, y); } else { DemoGame.Graphics2D.AddSprite("Mess" + i, str, 0xffffffff, x, y); } DemoGame.Graphics2D.DrawSprites(); } useGraphDev.Graphics.SwapBuffers(); for (int i = 0; i < fixEntryStringList.Length; i++) { DemoGame.Graphics2D.RemoveSprite("Mess" + i); } DemoGame.Graphics2D.RemoveSprite("Mess"); return(true); }
/// 描画処理 public bool Render() { if (nowTaskId != nextTaskId) { nowTaskId = nextTaskId; return(true); } GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; useGraphDev.Graphics.SetClearColor(0.0f, 0.025f, 0.25f, 0.0f); useGraphDev.Graphics.Clear(); ctrlResMgr.DrawDebug(); switch (nowTaskId) { case debugMenuTaskId.SelectObj: renderSelectObj(); break; case debugMenuTaskId.MoveObj: renderMoveObj(); break; case debugMenuTaskId.GravityObj: renderGravityObj(); break; case debugMenuTaskId.DeleteObj: renderDeleteObj(); break; } /// 境界ボリュームの表示 /// if( trgObj != null ){ /// trgObj.GetBoundSphere().Draw( useGraphDev, 0, new Rgba(0xff, 0x00, 0x00, 0x80), new Rgba(0xff, 0x00, 0x00, 0x80) ); /// } /// 描画 useGraphDev.Graphics.SwapBuffers(); return(true); }
internal void DrawSprites(DemoGame.GraphicsDevice graphDev) { FrameBuffer fbuffer = graphicsContext.GetFrameBuffer(); // Matrix4 projection = Matrix4.Ortho( 0, fbuffer.Width, fbuffer.Height, 0, -100.0f, 100.0f ) ; float aspect = graphicsContext.Screen.AspectRatio; float fov = FMath.Radians(45.0f); Matrix4 projection = graphDev.GetCurrentCamera().ViewProjection; // graphicsContext.Enable( EnableMode.Blend ) ; graphDev.Graphics.Enable(EnableMode.CullFace); graphDev.Graphics.SetCullFace(CullFaceMode.None, CullFaceDirection.Ccw); graphDev.Graphics.Disable(EnableMode.DepthTest); graphicsContext.SetVertexBuffer(0, vertexBuffer); for (var sprite = drawList; sprite != null; sprite = sprite.drawNext) { var material = sprite.Material; graphicsContext.SetShaderProgram(material.ShaderProgram); material.ShaderProgram.SetUniformValue(0, ref projection); graphicsContext.SetBlendFunc(material.BlendFunc); graphicsContext.SetTexture(0, material.Texture); int next = (sprite.drawNext == null) ? indexCount : sprite.drawNext.indexID; graphicsContext.DrawArrays(DrawMode.Triangles, sprite.indexID, next - sprite.indexID); } }
public virtual bool DoDraw2(DemoGame.GraphicsDevice graphDev, Vector3 BasePos) { return(true); }
/// 描画 public override bool Draw(DemoGame.GraphicsDevice graphDev) { objFix.SetMdlHandle(fixTypeId, LodLev); return(DoDraw(graphDev)); }
/// 描画処理 public override bool DoDraw(DemoGame.GraphicsDevice graphDev) { useMdlHdl.Render(graphDev, baseMtx); useMdlEffHdl.Render(graphDev, baseMtx); return(true); }
/// 使用するグラフィクスデバイスの登録 public void SetGraphicsDevice(DemoGame.GraphicsDevice use) { graphDev = use; }
protected virtual bool DoDraw(DemoGame.GraphicsDevice graphDev) { return(true); }
/// 描画処理 protected override bool DoDraw(DemoGame.GraphicsDevice graphDev) { objFix.Draw(graphDev); return(true); }
/// 使用するグラフィクスデバイスの登録 public void SetGraphicsDevice( DemoGame.GraphicsDevice use ) { graphDev = use; }
/// 描画 public virtual bool Draw(DemoGame.GraphicsDevice graphDev) { return(false); }
/// 描画処理 public override bool DoDraw(DemoGame.GraphicsDevice graphDev) { objBullet.Draw(graphDev); return(true); }
public bool DrawAlpha(DemoGame.GraphicsDevice graphDev) { return(true); }
public bool Draw2(DemoGame.GraphicsDevice graphDev, Vector3 BasePos) { return(DoDraw2(graphDev, BasePos)); }
/// 破棄 public void Term() { GameCtrlDrawManager.GetInstance().Term(); ctrlPl.Term(); ctrlHobit.Term(); ctrlTo.Term(); ctrlWall.Term(); ctrlCam.Term(); ctrlStg.Term(); ctrlEffect.Term(); ctrlEvent.Term(); ctrlDesMark.Term(); ctrlHouse.Term(); ctrlMo.Term(); ctrlPl = null; ctrlHobit = null; ctrlTo = null; ctrlWall = null; ctrlCam = null; ctrlStg = null; ctrlEffect = null; ctrlEvent = null; ctrlDesMark = null; ctrlHouse = null; ctrlMo = null; graphDev = null; }
/// 描画処理 public bool Render() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; useGraphDev.Graphics.SetClearColor(0.5f, 0.5f, 0.5f, 0.0f); useGraphDev.Graphics.Clear(); GameCtrlManager.GetInstance().DrawTitle(); DemoGame.Graphics2D.FillRect(0x80000040, 0, 0, useGraphDev.DisplayWidth, useGraphDev.DisplayHeight); /// BGの描画 if (pageTbl.sprBg != null) { DemoGame.Graphics2D.DrawSprite(pageTbl.sprBg, touchMoveX, 0); } /// イメージ画の描画 for (int i = 0; i < trlDataTbl[pageNow].GetInfoNum(); i++) { if (pageTbl.sprObj[i] != null) { DemoGame.Graphics2D.DrawSprite(pageTbl.sprObj[i], touchMoveX, 0); } } /// フォントの表示 for (int i = 0; i < trlDataTbl[pageNow].GetInfoNum(); i++) { DemoGame.Graphics2D.FillRect(0x20000040, pageFontPosTbl[(startPosIdx + i) * 2 + 0] + AppLyout.GetInstance().OffsetW - 110 + touchMoveX, pageFontPosTbl[(startPosIdx + i) * 2 + 1] + AppLyout.GetInstance().OffsetH - 62, 220, 124); for (int j = 0; j < trlDataTbl[pageNow].GetMessLen(i); j++) { int strW = DemoGame.Graphics2D.CurrentFont.GetTextWidth(trlDataTbl[pageNow].GetMess(i, j)); int strH = DemoGame.Graphics2D.CurrentFont.Size; int posX = pageFontPosTbl[(startPosIdx + i) * 2 + 0] + AppLyout.GetInstance().OffsetW - strW / 2; int posY = pageFontPosTbl[(startPosIdx + i) * 2 + 1] + AppLyout.GetInstance().OffsetH - (trlDataTbl[pageNow].GetMessLen(i) * strH / 2) + j * strH; DemoGame.Graphics2D.AddSprite("Mess" + i * 10 + j, trlDataTbl[pageNow].GetMess(i, j), 0xffffffff, touchMoveX + posX, posY); } } /// スプライトの描画 AppLyout.GetInstance().Render(); for (int i = 0; i < trlDataTbl[pageNow].GetInfoNum(); i++) { for (int j = 0; j < trlDataTbl[pageNow].GetMessLen(i); j++) { DemoGame.Graphics2D.RemoveSprite("Mess" + i * 10 + j); } } AppDispEff.GetInstance().Draw(useGraphDev); useGraphDev.Graphics.SwapBuffers(); return(true); }
/// 描画処理 public bool Draw(DemoGame.GraphicsDevice graphDev) { actorBehind.Draw(graphDev); return(true); }
/// フレーム処理:ページ移動 private bool updatePageMove() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; switch (taskId) { /// 掃ける ///-------------------------------------- case 0: setPageArrow(-1); if ((eventState & EveStateId.PageNext) != 0) { touchMoveX -= (useGraphDev.DisplayWidth / 6); } else { touchMoveX += (useGraphDev.DisplayWidth / 6); } if (abs(touchMoveX) > useGraphDev.DisplayWidth) { taskId++; } break; /// 読み替え ///-------------------------------------- case 1: if ((eventState & EveStateId.PageNext) != 0) { touchMoveX = useGraphDev.DisplayWidth; pageNow++; if (pageNow >= pageMax) { pageNow = pageMax - 1; } } else { touchMoveX = -useGraphDev.DisplayWidth; pageNow--; if (pageNow < 0) { pageNow = 0; } } loadPageImage(pageNow); touchMoveFlg = false; taskId++; break; /// フレームイン ///-------------------------------------- case 2: if (touchMoveX < 0) { touchMoveX += (useGraphDev.DisplayWidth / 6); if (touchMoveX > 0) { touchMoveX = 0; setStateTask(StateId.Normal); } } else { touchMoveX -= (useGraphDev.DisplayWidth / 6); if (touchMoveX < 0) { touchMoveX = 0; setStateTask(StateId.Normal); } } break; } return(true); }
/// 描画 public override bool Draw(DemoGame.GraphicsDevice graphDev) { return(DoDraw(graphDev)); }
/// 入力イベントのチェック private void checkInputButtons() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev; int devPosX = AppInput.GetInstance().DevicePosX; int devPosY = AppInput.GetInstance().DevicePosY; eventState = 0; /// 戻る ///-------------------------------------------------------------- if (AppInput.GetInstance().DeviceInputId >= 0 && AppLyout.GetInstance().CheckRect(AppLyout.SpriteId.Back_on, devPosX, devPosY)) { AppLyout.GetInstance().ClearSprite(AppLyout.SpriteId.Back_off); AppLyout.GetInstance().SetSprite(AppLyout.SpriteId.Back_on); if (AppInput.GetInstance().CheckDeviceSingleTouchUp() == true) { eventState = EveStateId.TitleBack; } } else { AppLyout.GetInstance().ClearSprite(AppLyout.SpriteId.Back_on); AppLyout.GetInstance().SetSprite(AppLyout.SpriteId.Back_off); } /// ページ送り ///-------------------------------------------------------------- if (eventState == 0 && abs(touchMoveX) < useGraphDev.DisplayWidth / 20) { if (AppInput.GetInstance().DeviceInputId >= 0 && devPosX < ((useGraphDev.DisplayWidth / 2) - 374)) { if (pageNow > 0) { if (AppInput.GetInstance().CheckDeviceSingleTouchUp() == true) { eventState = EveStateId.PageBack; } } } else if (AppInput.GetInstance().DeviceInputId >= 0 && devPosX >= ((useGraphDev.DisplayWidth / 2) + 374)) { if (pageNow + 1 < pageMax) { if (AppInput.GetInstance().CheckDeviceSingleTouchUp() == true) { eventState = EveStateId.PageNext; } } } } /// ページ切り替え入力判定 ///-------------------------------------------------------------- if (AppInput.GetInstance().CheckDeviceSingleTouchDown()) { touchStartX = devPosX; touchMoveX = devPosX - touchStartX; touchMoveFlg = true; } if (touchMoveFlg == true && AppInput.GetInstance().CheckDeviceSingleTouching()) { touchMoveX = devPosX - touchStartX; if ((pageNow + 1 >= pageMax && touchMoveX < 0) || (pageNow <= 0 && touchMoveX > 0)) { touchMoveX = 0; } } else if (touchMoveX > 0) { touchMoveX -= (useGraphDev.DisplayWidth / 10); if (touchMoveX < 0) { touchMoveX = 0; } } else if (touchMoveX < 0) { touchMoveX += (useGraphDev.DisplayWidth / 10); if (touchMoveX > 0) { touchMoveX = 0; } } if (AppInput.GetInstance().CheckDeviceSingleTouchUp() == true) { if (touchMoveX >= (useGraphDev.DisplayWidth / 3)) { eventState = EveStateId.PageBack; } else if (touchMoveX < -(useGraphDev.DisplayWidth / 3)) { eventState = EveStateId.PageNext; } } }
/// 描画処理 protected override bool DoDraw(DemoGame.GraphicsDevice graphDev) { objCh.Draw2(graphDev, BasePos); return(true); }
/// 描画処理 public override bool DoDraw( DemoGame.GraphicsDevice graphDev ) { Matrix4 worldMatrix = baseMtx * Matrix4.Scale( baseScale ); useMdlEffHdl.Render( graphDev, worldMatrix, 1.0f ); return true; }