public override Material DrawMat(IntRot rot) { { if (this.roll <= 0) { return(Mat_Spacer_Clean); } if (this.roll <= 1 && roll > 0) { return(Mat_Spacer_Clutter); } if (this.roll <= 2 && roll > 1) { return(Mat_Midworld_Clean); } if (this.roll <= 3 && roll > 2) { return(Mat_Midworld_Clutter); } else { return(Mat_Spacer_Clean); } } }
public override Material DrawMat(IntRot rot) { { return((!this.TClean) ? this.clutterMat : this.cleanMat); } }
//public virtual void PostDeSpawn(); //public virtual void PostDestroy(DestroyMode mode = DestroyMode.Vanish); public override void PostDraw() { float wheelShake = (float)((Math.Sin(tick_time) + Math.Abs(Math.Sin(tick_time))) / 40.0); IntRot rotation = new IntRot(0); Vector3 drawLoc = new Vector3(parent.Position.x, parent.Position.y, parent.Position.z); Vector3 compOffset = new Vector3((float)-0.2, (float)0, (float)(0.2 + wheelShake)); graphic.Draw(drawLoc + compOffset, rotation, parent); }
//public virtual void PostDeSpawn(); //public virtual void PostDestroy(DestroyMode mode = DestroyMode.Vanish); public override void PostDraw() { float wheelShake = (float)((Math.Sin(tick_time) + Math.Abs(Math.Sin(tick_time))) / 40.0); IntRot rotation = new IntRot(0); Vector3 drawLoc = new Vector3(parent.Position.x, parent.Position.y, parent.Position.z); Vector3 compOffset = new Vector3((float)-0.2, (float)0, (float)(0.2 + wheelShake)); graphic.Draw(drawLoc + compOffset, rotation, parent); }
public override void DrawAt(Vector3 drawLoc) { base.DrawAt(drawLoc); float wheelShake = (float)((Math.Sin(tick_time) + Math.Abs(Math.Sin(tick_time))) / 40.0); IntRot rotation = new IntRot(0); Vector3 compOffset = new Vector3((float)-1.2, (float)0, (float)(1.2 + wheelShake)); Log.Message("Wheel graphic info" + graphic.GraphicPath + graphic.MatSide.name); graphic.Draw(drawLoc + compOffset, rotation, parent); }
public override void DrawAt(Vector3 drawLoc) { base.DrawAt(drawLoc); float wheelShake = (float)((Math.Sin(tick_time) + Math.Abs(Math.Sin(tick_time))) / 40.0); IntRot rotation = new IntRot(0); Vector3 compOffset = new Vector3((float)-1.2, (float)0, (float)(1.2 + wheelShake)); Log.Message("Wheel graphic info" + graphic.GraphicPath + graphic.MatSide.name); graphic.Draw(drawLoc + compOffset, rotation, parent); }
/// <summary> /// /// </summary> public override void DrawAt(Vector3 drawLoc) { //base.DrawAt(drawLoc); IntRot rotation = base.Rotation; Vector3 layer = new Vector3(0, Altitudes.AltitudeFor(AltitudeLayer.Waist) - drawLoc.y, 0); Vector3 handleLoc = drawLoc; handleLoc.y = Altitudes.AltitudeFor(AltitudeLayer.Waist) + 0.01f; Vector3 wheelLoc = drawLoc; wheelLoc.y = Altitudes.AltitudeFor(AltitudeLayer.Waist) + 0.04f; Vector3 bodyLoc = drawLoc; bodyLoc.y = Altitudes.AltitudeFor(AltitudeLayer.Waist) + 0.03f; Vector3 mountThingLoc = drawLoc; mountThingLoc.y = Altitudes.AltitudeFor(AltitudeLayer.Pawn); Vector3 mountThingOffset = new Vector3(0, 0, 1).RotatedBy(this.Rotation.AsAngle); Vector3 itemLoc = drawLoc; itemLoc.y = Altitudes.AltitudeFor(AltitudeLayer.PawnState); Vector3 itemOffset = new Vector3(0.02f, 0, 0).RotatedBy(this.Rotation.AsAngle); Log.Message("Altitude For Pawn: " + Altitudes.AltitudeFor(AltitudeLayer.Waist).ToString() + handleLoc.ToString() + drawLoc.ToString()); float wheel_shake = (float)((Math.Sin(tick_time) + Math.Abs(Math.Sin(tick_time))) / 40.0); wheelLoc.z = wheelLoc.z + wheel_shake; if (!this.mountContainer.Empty) { foreach (var mountThing in this.mountContainer.Contents) { Pawn p = (Pawn)mountThing; p.ExposeData(); p.Rotation = this.Rotation; p.DrawAt(mountThingLoc + mountThingOffset); p.DrawGUIOverlay(); } } if (this.Rotation.AsInt % 2 == 0) //Vertical { wheelLoc.y = Altitudes.AltitudeFor(AltitudeLayer.Waist) + 0.02f; } graphic_Wheel.Draw(wheelLoc, rotation, this); graphic_Body.Draw(bodyLoc, rotation, this); graphic_Handle.Draw(handleLoc, rotation, this); if (!this.inventory.container.Empty) { float i = 0f; foreach (var thing in this.inventory.container.Contents) { i += 0.01f; itemLoc.y = Altitudes.AltitudeFor(AltitudeLayer.PawnState) + i; itemOffset.x += i; thing.Graphic.Draw(itemLoc + itemOffset, rotation, this); } } }
public override Material DrawMat(IntRot rot) { if (this.animation > 20) { return MeteorIncoming.frame1; } if (this.animation < 10) { return MeteorIncoming.frame3; } return MeteorIncoming.frame2; }
/// <summary> /// /// </summary> public override void DrawAt(Vector3 drawLoc) { base.DrawAt(drawLoc); IntRot rotation = base.Rotation; Vector3 drawWheel = drawLoc; Vector3 drawBackWheel = drawLoc; float wheel_shake = (float)((Math.Sin(tick_time) + Math.Abs(Math.Sin(tick_time))) / 40.0); drawWheel.z = drawWheel.z + wheel_shake; IntRot pawnDirection = this.Rotation; bool pawnIsHorizen = (pawnDirection.AsInt % 2 == 1) ? true : false; if (pawnIsHorizen) { if (!this.mountContainer.Empty) { foreach (var mountThing in this.mountContainer.Contents) { Pawn p = (Pawn)mountThing; p.ExposeData(); //Graphic_Linked mountGraphic = new Graphic_Linked(p.Graphic); //mountGraphic.Draw(drawLoc, rotation, this); p.DrawAt(drawLoc); } } graphic_Wheel.Draw(drawWheel, rotation, this); graphic_Body.Draw(drawLoc, rotation, this); graphic_Handle.Draw(drawLoc, rotation, this); if (!this.inventory.container.Empty) { foreach (var thing in this.inventory.container.Contents) { thing.Graphic.Draw(drawLoc, rotation, this); } } } else { graphic_Body.Draw(drawLoc, rotation, this); graphic_Handle.Draw(drawLoc, rotation, this); graphic_Wheel.Draw(drawWheel, rotation, this); if (!this.inventory.container.Empty) { foreach (var thing in this.inventory.container.Contents) { thing.Graphic.Draw(drawLoc, rotation, this); } } } }
public override Material DrawMat(IntRot rot) { { if (charge > 0) { return(Afs_On); } else { return(Afs_Off); } } }
public override void Draw() { base.Draw(); GenDraw.FillableBarRequest r = default(GenDraw.FillableBarRequest); r.center = this.DrawPos + Vector3.up * 0.1f; r.size = Building_SmallPowerPlantSolar.BarSize; r.fillPercent = this.powerComp.powerOutput / 900f; r.filledMat = Building_SmallPowerPlantSolar.BarFilledMat; r.unfilledMat = Building_SmallPowerPlantSolar.BarUnfilledMat; r.margin = 0.15f; IntRot rotation = this.Rotation; rotation.Rotate(RotationDirection.Clockwise); r.rotation = rotation; GenDraw.DrawFillableBar(r); }
public override Material DrawMat(IntRot rot) { { if (this.Tswitch <= 20) { return(PlasmaF1); } if (this.Tswitch >= 21 && this.Tswitch <= 40) { return(PlasmaF2); } else { return(PlasmaF3); } } }
public override void Draw() { //Note: It's a bit odd that I'm changing game variables in Draw // but this is the easiest way to make this always look right even if // conditions change while the game is paused. rotation = DoorRotationAt(Position); //Draw the two moving doors float pctOpen = (float)visualTicksOpen / (float)VisualOpenTicksMax; float doorOffset = VisualDoorOffsetStart + (VisualDoorOffsetEnd - VisualDoorOffsetStart) * pctOpen; for (int i = 0; i < 2; i++) { Vector3 doorPos = DrawPos; doorPos.y = Altitudes.AltitudeFor(AltitudeLayer.DoorMoveable); Vector3 offsetNormal = new Vector3(); if (i == 0) { offsetNormal = new Vector3(0, 0, 1); } else { offsetNormal = new Vector3(0, 0, -1); } IntRot openDir = rotation; openDir.Rotate(RotationDirection.Clockwise); offsetNormal = openDir.AsQuat * offsetNormal; doorPos += offsetNormal * doorOffset; Vector3 Scaler = new Vector3(0.5f, 0.5f, 0.5f); Matrix4x4 Matrix = new Matrix4x4(); Matrix.SetTRS(doorPos, openDir.AsQuat, Scaler); Graphics.DrawMesh(MeshPool.plane10, Matrix, def.drawMat, 0); } Comps_Draw(); }
public override void Draw() { base.Draw(); CompPowerBattery comp = base.GetComp <CompPowerBattery>(); GenDraw.FillableBarRequest r = default(GenDraw.FillableBarRequest); r.center = this.DrawPos + Vector3.up * 0.1f; r.size = Building_BatteryMk2.BarSize; r.fillPercent = comp.StoredEnergy / comp.props.storedEnergyMax; r.filledMat = Building_BatteryMk2.BarFilledMat; r.unfilledMat = Building_BatteryMk2.BarUnfilledMat; r.margin = 0.15f; IntRot rotation = base.Rotation; rotation.Rotate(RotationDirection.Clockwise); r.rotation = rotation; GenDraw.DrawFillableBar(r); if (this.ticksToExplode > 0) { OverlayDrawer.DrawOverlay(this, OverlayTypes.BurningWick); } }
public override void Draw() { base.Draw(); GenDraw.FillableBarRequest req = new GenDraw.FillableBarRequest(); req.center = DrawPos + Vector3.up * 0.1f; req.size = BarSize; req.fillPercent = powerComp.powerOutput / FullSunPower; //if(req.FillPercent > 0.01f ) // req.FillPercent += Mathf.Sin((Find.TickManager.tickCount+thingIDNumber) * BarWobbleFreq) * BarWobbleAmp; req.filledMat = BarFilledMat; req.unfilledMat = BarUnfilledMat; req.margin = 0.15f; IntRot rot = rotation; rot.Rotate(RotationDirection.Clockwise); req.rotation = rot; GenDraw.DrawFillableBar(req); }
// Texture material public override Material DrawMat(IntRot rot) { return(HoloSave); }
public static IntVec3 InteractionSquareWhenAt( EntityDef tDef, IntVec3 loc, IntRot rot ) { IntVec3 rotatedOffset = tDef.interactionSquareOffset.RotatedBy(rot); return loc + rotatedOffset; }
public override Material DrawMat(IntRot rot) { if (this.LifeStage == PlantLifeStage.Sowing) { return PlantAll.MatSowing; } return base.DrawMat(rot); }
public static IntVec3 InteractionSquareWhenAt(EntityDef tDef, IntVec3 loc, IntRot rot) { IntVec3 rotatedOffset = tDef.interactionSquareOffset.RotatedBy(rot); return(loc + rotatedOffset); }