/// <summary> /// Render /// </summary> public void Render() { if (mAlpha <= 0) { return; } RB.TintColorSet(ColorTint); byte prevAlpha = RB.AlphaGet(); RB.AlphaSet((byte)(mAlpha * prevAlpha)); int LifeFrame = 5 - (int)(((float)Life / (float)MaxLife) * 5); if (Type != BrickType.Block) { LastSpriteRect = new Rect2i(Global.BRICK_WIDTH * LifeFrame, 0, Rect.width, Rect.height); } else { LastSpriteRect = new Rect2i(120, 0, 20, 10); } RB.DrawCopy(LastSpriteRect, Rect); for (int i = 0; i < FlashFrame; i++) { RB.DrawRect(new Rect2i(Rect.x + i, Rect.y + i, Rect.width - (i * 2), Rect.height - (i * 2)), Color.white); } RB.TintColorSet(Color.white); RB.AlphaSet(prevAlpha); }
/// <summary> /// Render /// </summary> public void Render() { byte prevAlpha = RB.AlphaGet(); // Be sure to account for shadow render pass here RB.AlphaSet((byte)((mAlpha / 255.0f) * prevAlpha)); RB.DrawCopy(new Rect2i(127, 10, 5, 8), new Rect2i((int)mPos.x, (int)mPos.y, 5, 8)); RB.AlphaSet(prevAlpha); }
/// <summary> /// Render /// </summary> public void Render() { byte prevAlpha = RB.AlphaGet(); // Be sure to account for shadow render pass here RB.AlphaSet((byte)((mAlpha / 255.0f) * prevAlpha)); RB.DrawSprite(RB.SpriteIndex(FlashFrame, 2), new Vector2i(Rect.x, Rect.y)); RB.AlphaSet(prevAlpha); }
/// <summary> /// Render /// </summary> public void Render() { RB.DrawNineSlice(Rect, mNSFrame[FlashFrame]); if (mLaserOffset < 1.0f) { Vector2i offset = Vector2i.zero; offset.x = (int)(16 * mLaserOffset); offset.y = (int)(8 * mLaserOffset); byte prevAlpha = RB.AlphaGet(); RB.AlphaSet((byte)((1 - mLaserOffset) * prevAlpha)); RB.DrawCopy(new Rect2i(120, 10, 7, 10), new Rect2i(Rect.x - 3 - offset.x, Rect.y - 2 - offset.y, 7, 10)); RB.DrawCopy(new Rect2i(120, 10, 7, 10), new Rect2i(Rect.x + Rect.width - 4 + offset.x, Rect.y - 2 - offset.y, 7, 10)); RB.AlphaSet(prevAlpha); } }
/// <summary> /// Render /// </summary> public void Render() { for (int i = 0; i < mParticles.Count; i++) { RB.TintColorSet(mParticles[i].ColorTint); float alpha = 1.0f; if (mParticles[i].Life < 0.5f) { alpha = mParticles[i].Life / 0.5f; } byte prevAlpha = RB.AlphaGet(); RB.AlphaSet((byte)(prevAlpha * alpha)); RB.DrawCopy(mParticles[i].Rect, new Vector2i((int)mParticles[i].Pos.x, (int)mParticles[i].Pos.y)); RB.AlphaSet(prevAlpha); RB.TintColorSet(Color.white); } }