void RenderBGR7() { if (bgrtoggle < 5) { bgrtoggle++; return; } bgrtoggle -= 5; if (bgrtick > 100) { bgrproc = null; return; } Blitter b = new Blitter(bg); b.Blit(bg3, 0, 0); SetLucent(b,100 - bgrtick); b.Blit(bg2, 0, 0); bgrtick++; }
void InitializeBGR7() { bgrtick = 0; bgrtoggle = 0; //???? TODO //SetClip(0, 0, 255, 255, bg); //SetClip(0, 0, 255, 255, bg2); //SetClip(0, 0, 255, 255, bg3); Blitter b = new Blitter(bg3); b.Blit(bg, 0, 0); bgrproc = RenderBGR7; }
protected override void Draw(GameTime gameTime) { Blitter b = new Blitter(screen); bCurr = b; b.Clear(Color.Gray); //do it with supersecret SuperSecretThingy(scrollofs/16, systemtime/2, 0, bg, SuperSecretBuffer); b.Blit(SuperSecretBuffer); //do it plain for debugging //WrapBlit(b, bg, 0, 0); //b.ScaleBlit(bobgreen, 0, 0, 100, 100); RenderSprites(b); app.Window.Title = systemtime.ToString(); //b.ScaleBlit(spherepurple, 0, 0, 100,100); //test }
void RenderBGR5() { if (bgrtoggle < 4) { bgrtoggle++; return; } bgrtoggle -= 4; if (bgrtick > 63) { bgrproc = null; return; } int y = bgrtick / 8; int x = bgrtick % 8; Blitter b = new Blitter(bg); b.Blit(bgr5img, x * 32, y * 32); bgrtick++; }
void RenderBGR3() { if (bgrtoggle < 1) { bgrtoggle++; return; } bgrtoggle -= 1; if (bgrtick > 200) { bgrproc = null; return; } Blitter b = new Blitter(bg); b.Blit(bg2, 0, 0); b.Alpha = (bgrtick / 2)/100.0f; b.RectFill(0, 0, 256, 256); bg.Cache(); bgrtick++; }
/// <summary> /// loads a spritemanager by dicing a source image /// </summary> public SpriteManager LoadSpriteManager(Image source, int width, int height, int xpad, int ypad) { //TODO - don't do this with blitting. that way we can keep the source texture format. but this will work for now.. SpriteManager ret = new SpriteManager(); int framesAcross = source.Width / (width+xpad); int framesDown = source.Height / (height+ypad); ret.NumFrames = framesAcross*framesDown; ret.frames = new Image[ret.NumFrames]; int ctr=0; DisableAlphaBlend(); for (int iy=0; iy<framesDown; iy++) { for(int ix=0;ix<framesAcross; ix++,ctr++) { Image img = NewImage(width, height); ret.frames[ctr] = img; Blitter b = new Blitter(img); //b.Clear(Color.Transparent); b.Blit(source, -ix*(width+xpad), -iy*(height+ypad)); img.Cache(); img.Premultiply(); } } EnableAlphaBlend(); return ret; }
/// <summary> /// Provided as a convenience for similarity to verge, this merely calls Blit in the correct pattern to simulate the desired result /// </summary> void BlitWrap(Blitter b, Image src, int x, int y) { int ox = x + src.Width - b.Dest.Width; int oy = y + src.Height - b.Dest.Height; b.Blit(src, x, y); if(ox>0) b.Blit(src, -ox, y); if (oy > 0) b.Blit(src, x, -oy); if(ox>0 && oy>0) b.Blit(src, -ox, -oy); }
/// <summary> /// Provided as a convenience for similarity to verge, this merely calls SetTextureWrap(true) and then does a blit /// (to be moved into Blitter eventually) /// </summary> void WrapBlit(Blitter b, Image src, int x, int y) { SetTextureWrap(true); b.Blit(src, x, y); SetTextureWrap(false); }
public void Blit(Blitter b) { for (int y = 0; y < BlocksHeight; y++) for (int x = 0; x < BlocksWidth; x++) { b.Blit(Images[x, y], x * 2048, y * 2048); } }
void renderPlayerRoot(Blitter b) { Character c = (mainMenuNavigator.submenuAt(0) as CharacterMenu).character; b.PushWindow(); wr.render(b, new Rectangle(0, 0, 200, 66), WindowRenderer.Mode.Light); cabedge.font_v3_2_black.Render(b, 25, 12, c.name); cabedge.font_v3_1_black.Render(b, 25, 32, string.Format("{0} / {1}", c.hp, c.baseStats.mhp + c.bonusStats.mhp)); cabedge.font_v3_1_black.Render(b, 25, 42, c.classname); Image portrait = c.getPortrait(); if(portrait != null) b.Blit(portrait, 160, 10); b.PopWindow(); }
void BlitAt(int x, int y, Image img, Blitter b) { b.Blit(img, x - (img.Width / 2), y - (img.Height / 2)); }