May 12, 20205 yr Hi folks, I am starting to learn to write scripts for Rage and am struggling as a beginner. It is a little bit intimidating just to print a Hello, World text. I mean, I have figured out how to use Game.DisplayNotification, Game.DisplayHelp, etc, but I am trying to figure out how to draw text to the screen. For my first script, I want to write a simple speedometer, with nothing fancy that just displays my player's current vehicle, with no other features. Here's my code: I am able to load the plugin into Rage, but my speedometer handle isn't being called at all. Attached is my code: public static void Main() { GameFiber.StartNew(delegate { if(Game.LocalPlayer.Character.IsInAnyVehicle(false)) { Game.FrameRender += Speedometer; } while (true) { GameFiber.Yield(); } }); } private static void Speedometer(object sender, GraphicsEventArgs e) { Ped playerPed = Game.LocalPlayer.Character; Game.LogTrivial("Speedometer is being called."); Vehicle vehicle = playerPed.CurrentVehicle; Rectangle drawRect = new Rectangle(1, 250, 230, 117); e.Graphics.DrawRectangle(drawRect, Color.FromArgb(200, Color.Black)); e.Graphics.DrawText(vehicle.Speed.ToString(), "Arial Bold", 20.0f, new PointF(0f, 0f), Color.White, drawRect); } I have looked at the Rage Plugin hook documentation, but it does not really explain much on Drawing text. I have watched Albo1125's videos on C#, and have also looked at his source code on git hub for days, but I still have no idea what I'm doing wrong. Any help is much appreciated. Also will appreciate better places to learn more about Rage development. Thanks!! Edited May 13, 20205 yr by The Big House
May 16, 20205 yr Author Pardon the bump, but I would like a little help on this, just to get the basics down.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.