public void RenderWorld(GameTime game_time, xAABB2 view_aabb) { if (!mRendered) { XSimpleDraw simple_draw = XSimpleDraw.Instance(xeSimpleDrawType.WorldSpace_Persistent_Map); System.Random rand = new Random(); mMap.Iterate((grid, x, y) => { Vector3 low = new Vector3(x, y, 0f); Vector3 high = new Vector3(x + 1, y + 1, 0f); Color color = grid.mData[x, y].mColor; simple_draw.DrawQuad(low, high, color); }); // render world lines in here if they are static // RenderWorldLines_Static(); mRendered = true; } // render world lines here if they are dynamic RenderWorldLines_Dynamic(view_aabb); }
public void Util_DrawBox(XSimpleDraw simple_draw, Style style, xAABB2 screen_aabb) { Vector3 lo_x_lo_y = new Vector3(screen_aabb.GetMin(), 0); Vector3 hi_x_hi_y = new Vector3(screen_aabb.GetMax(), 0); Vector2 size = screen_aabb.GetSize(); Vector3 lo_x_hi_y = lo_x_lo_y + new Vector3(0, size.Y, 0); Vector3 hi_x_lo_y = lo_x_lo_y + new Vector3(size.X, 0, 0); simple_draw.DrawQuad(lo_x_lo_y, hi_x_hi_y, style.mBackgroundColor); simple_draw.DrawLine(lo_x_lo_y, hi_x_lo_y, style.mBorderColor); simple_draw.DrawLine(hi_x_lo_y, hi_x_hi_y, style.mBorderColor); simple_draw.DrawLine(hi_x_hi_y, lo_x_hi_y, style.mBorderColor); simple_draw.DrawLine(lo_x_hi_y, lo_x_lo_y, style.mBorderColor); }
void _IButton.Draw(XSimpleDraw simple_draw) { // draw border and background, then draw core Vector3 lo = new Vector3(mAABB.GetMin(), 2); // zero might not be right z Vector3 hi = new Vector3(mAABB.GetMax(), 2); Color body_color = mButtonCore.mPressed ? mButtonCore.mPressedColor : mButtonCore.mStyle.mBackgroundColor; Color border_color = mButtonCore.mStyle.mBorderColor; simple_draw.DrawQuad(lo, hi, body_color); simple_draw.DrawLine(lo, mCorner2, border_color); simple_draw.DrawLine(mCorner2, hi, border_color); simple_draw.DrawLine(hi, mCorner3, border_color); simple_draw.DrawLine(mCorner3, lo, border_color); mButtonCore.Draw(simple_draw); }
void _ISelector.Draw(XSimpleDraw simple_draw) { if (mRenderEnabled) { // draw the title and background, buttons will draw themselves Style style = XUI.Instance().GetStyle(mStyle); Color widget_color = style.mBackgroundColor; Color border_color = style.mBorderColor; Vector3 lo_x_lo_y = new Vector3(mAABB.GetMin(), 1); Vector3 hi_x_hi_y = new Vector3(mAABB.GetMax(), 1); Vector2 size = mAABB.GetSize(); Vector3 lo_x_hi_y = lo_x_lo_y + new Vector3(0, size.Y, 0); Vector3 hi_x_lo_y = lo_x_lo_y + new Vector3(size.X, 0, 0); simple_draw.DrawQuad(lo_x_lo_y, hi_x_hi_y, widget_color); simple_draw.DrawLine(lo_x_lo_y, hi_x_lo_y, border_color); simple_draw.DrawLine(hi_x_lo_y, hi_x_hi_y, border_color); simple_draw.DrawLine(hi_x_hi_y, lo_x_hi_y, border_color); simple_draw.DrawLine(lo_x_hi_y, lo_x_lo_y, border_color); } }