Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Turbo.Plugins.Smoochy
- {
- using System;
- using Turbo.Plugins.Default;
- public class EssencePlugin : BasePlugin, IInGameTopPainter
- {
- public TopLabelDecorator EssenceLabelDecorator { get; set; }
- public EssencePlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- EssenceLabelDecorator = new TopLabelDecorator(Hud)
- {
- TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 175, 238, 238, true, false, false), //this configures the size of the numbers ("7") and the color in RGB ("255, 175, 238, 238")
- BackgroundTexture1 = hud.Texture.ButtonTextureBlue,
- BackgroundTexture2 = hud.Texture.BackgroundTextureBlue,
- BackgroundTextureOpacity2 = 0.5f,
- TextFunc = () => (Math.Truncate(Hud.Game.Me.Stats.ResourceCurPri) + "/" + Hud.Game.Me.Stats.ResourceMaxPri),
- };
- }
- public void PaintTopInGame(ClipState clipState)
- {
- var xPos = Hud.Window.Size.Width * 0.5f; //this is the horizontal position
- var yPos = Hud.Window.Size.Height * 0.5f; //this is the vertical position
- var bgWidth = 90; //this is the width of the background texture
- var bgHeight = 30; //this is the heigth of the background texture
- if (clipState == ClipState.BeforeClip)
- {
- EssenceLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement