public Slot(int x, int y) { back = new GUCVisual(x, y, SlotSize, SlotSize); back.SetBackTexture(TextureSlot); vis = new GUCVobVisual(x, y, SlotSize, SlotSize); amount = vis.CreateText("", SlotSize - 5, SlotSize - 5 - FontsizeDefault); amount.Format = GUCVisualText.TextFormat.Right; }
public void PositionInVobVisual(GUCVobVisual vis) { Vec3f offset; Angles angles; switch (this.ItemType) { case ItemTypes.Wep1H: case ItemTypes.Wep2H: offset = new Vec3f(40, -15, 25); angles = new Angles(-Angles.PI / 2.0f, 0, 0.5235988f); break; case ItemTypes.WepXBow: offset = new Vec3f(15, -15, -5); angles = new Angles(-Angles.PI / 2.0f, 0, 0.5235988f); break; case ItemTypes.WepBow: offset = new Vec3f(-15, -15, 50); angles = new Angles(-Angles.PI / 2.0f, 0, 0.5235988f); break; case ItemTypes.Drinkable: offset = new Vec3f(0, -10, -60); angles = new Angles(0, 0, 0); break; case ItemTypes.AmmoBow: offset = new Vec3f(20, -10, -25); angles = new Angles(-Angles.PI / 2.0f, 0, 0.4363323f); break; case ItemTypes.AmmoXBow: offset = new Vec3f(5, -2.5f, -70); angles = new Angles(0, 0, 0.4363323f); break; default: offset = new Vec3f(0, 0, 0); angles = new Angles(0, 0, 0); break; } vis.OffsetX = offset.X + this.InvOffset.X; vis.OffsetY = offset.Y + this.InvOffset.Y; vis.OffsetZ = offset.Z + this.InvOffset.Z; vis.RotationPitch = angles.Pitch + this.InvRotation.Pitch; vis.RotationYaw = angles.Yaw + this.InvRotation.Yaw; vis.RotationRoll = angles.Roll + this.InvRotation.Roll; }
public GUCInventory(int x, int y, int cols, int rows, string backTex = TextureBackgroundDefault) { // create the background back = new GUCVisual(x, y, cols * SlotSize, rows * SlotSize); back.SetBackTexture(backTex); // create the slots slots = new Slot[cols, rows]; for (int i = 0; i < cols; i++) { for (int j = 0; j < rows; j++) { slots[i, j] = new Slot(x + i * SlotSize, y + j * SlotSize); } } // create the description descrBack = new GUCVisual((GetScreenSize().X - DescriptionBoxWidth) / 2, GetScreenSize().Y - DescriptionBoxHeight - 30, DescriptionBoxWidth, DescriptionBoxHeight); descrBack.SetBackTexture(backTex); // "Inv_Desc.tga"); descrBack.CreateTextCenterX("", 10); // title const int descrTextDist = FontsizeDefault - 3; for (int i = 0; i < 6; i++) // six info rows { descrBack.CreateText("", 20, 60 + i * descrTextDist); GUCVisualText count = descrBack.CreateText("", DescriptionBoxWidth - 20, 60 + i * descrTextDist); count.Format = GUCVisualText.TextFormat.Right; } descrVis = new GUCVobVisual(GetScreenSize().X / 2 + 160, GetScreenSize().Y - 128 - 48, 128, 128); // create the right info box rightBack = new GUCVisual(x + (cols - 2) * SlotSize, y - 20 - 35, 2 * SlotSize, 35); rightBack.SetBackTexture(backTex); rightVis = new GUCVisual(x + (cols - 2) * SlotSize, y - 20 - 35, 2 * SlotSize, 35); rightVis.SetBackTexture(TextureTitle); rightText = rightVis.CreateText("Gold: 0"); RightInfoBox = "GOLD"; // create the left info box leftBack = new GUCVisual(x, y - 20 - 35, 2 * SlotSize, 35); leftBack.SetBackTexture(backTex); leftVis = new GUCVisual(x, y - 20 - 35, 2 * SlotSize, 35); leftVis.SetBackTexture(TextureTitle); leftText = leftVis.CreateText("Gewicht: 0"); LeftInfoBox = "WEIGHT"; }
public MainMenuCharacter(string help, int x, int y, int w, int h) { HelpText = help; thisVob = oCNpc.Create(); vis = new GUCVobVisual(x, y, w, h) { Lighting = true, }; UpdateOrientation(); leftArrow = new GUCVisual(x + 150, y + h / 2 - 40, 15, 20); leftArrow.SetBackTexture("L.TGA"); rightArrow = new GUCVisual(x + w - 170, y + h / 2 - 40, 15, 20); rightArrow.SetBackTexture("R.TGA"); vis.CreateText("Zoom +/-", 120, 10); }