[Tutorial] Help Notification (Key or blips etc.) + 7 Contextual Code Ex./Snippets C# SHVDN3
-
@sneakybeaky18 If you mean display text on your screen, you can use subtitles, no? I do this when I want to position a prop in a ped's hand for example - to read the coordinates.
GTA.UI.Screen.ShowSubtitle
You could use notifications:
GTA.UI.Notification.Show
Not sure if this is useful, but you can also send that info to a text file:
My.Computer.FileSystem.WriteAllText("c:\Code.txt", String, False)
-
@JohnFromGWN thank you so much! im beginner at c# codding and gta modding. your info so useful for me. thank you!
-
@sneakybeaky18
GTA.UI.TextElement
is also an option so you can draw text however you like wherever you want on the screen.
-
var Text4Screen = new GTA.UI.TextElement(textString, pos, 0.45f, Color.White, GTA.UI.Font.ChaletLondon, GTA.UI.Alignment.Left, true, false, 400);
-
Wow guys , I love how this simple tutorial bring so much question/answer & argument ! (& Sharing !)
This community isn't dead, Thanks You All !:proud:
To keep the move ON, If people wants in LemonUI we also have LemonUI.Scaleform.BigMessage , To show message like next pict'
Each message types screen Here = https://rage.mp/files/file/26-scaleform-messages/(Screen from DaNubOne aka StrUng)
@Bet-Nimrod If you wants I may help you more, Just come ask in private or here. It will be a pleasure for me even for "simple" or "basic" knowledge
See you ! Happy to see new-comer
@sneakybeaky18 Happy to see it worked, & to see new-comer
Feel free to ask, here or in private, Always a pleasure to share passion, & as I said to Nimrod : even for "simple" or "basic" knowledge. See you !
@Jitnaught Thanks for your intervention, You made me realize that it need more precision on how SHVDN version changes the code ! I'm actually doing an improvement so thanks you ! (I'm talking to you & JustDancePC again after the next answer) Thanks for this really good analogy :D
Also thanks for sharing GTA.UI.TextElement
@JustDancePC Thanks for your feedback ! You're right In most case, See next (I'm talking to you & Jitnaught in next answer)
Some part of text is for @Jitnaught & some for @JustDancePC but the main idea & message is for both ! But this discuss is open to everyone
The things you both didn't said is there is 2 SHVDN3 function, one simple the one I explained ShowHelpTextThisFrame , but there is another one I discovered now, ShowHelpText this one allow everything that native do , so I'll edit the tutorial and add this last function !
I'm according you that it's not the most useful tutorial but as @JohnFromGWN & @JustDancePC said it may help understanding Natives, Programmation basic & other general knowledge.
@JustDancePC I know You dont mind that , But You said it's POINTLESS, You shouldn't say this or you have to precise, that it is pointless for everyday use/normal or not pointless because lots of people could appreciate thisIt Share : informations, knowledge, precise explained how to.
It may be really helpful to help working with native, as well as using method/function. As well Explaining all of this, may help people to understand how SHVDN is made, (And maybe contributing to improve/update or doing it their own). & Understanding HOW Natives Works (Which could be game Changer)So I think you do, but people need to keep in mind that , something could be pointless to them, to use , in practice, but theory and experience/knowledge (Basically how schools works ) in this part of the tutorial could be really useful to them or someone other, to a learning/beginning person or any other ! This is why it will remain here,
Finally if you think about creating a big mods using Help Text, creating those little & fast function, make The lost of time really negligible ! Also, Since you've got this tutorial in your favorite
With a quick Copy/Paste, & replace It may need only few sec' !
Luckily after that you said it's a good tutorial after thatNP
Anyway Thanks You both for pointing Miss & Helping me improving this tutorial, You will have a credits !
Thanks for your feedback !
An Update is incoming ASAP ! & a Tutorial on LemonUI.Scaleform.BigMessage may come soon
.
I'm open to suggestion for others tutorial needI
f it's that useless @Jitnaught or @JustDancePC Surely have "Better" idea for way "more useful" tutorial ?(I'm jocking guys xD)
See you !
-
@Kangouroux6 Very nice summary. I'm going to suggest two more things going forward.
- I'm sure many users, without guidance, start coding with SHVDN2 or LemonUI2 instead of 3 (or NativeUI which is no longer supported) . So it would be useful to give the 2 version as well in a tutorial to show the difference if someone is migrating or if they come across a different version and it causes confusion. Same would apply for native functions. Again when I started out I found lots of interesting functions, only to learn they had been replaced because VS rejected them.
For SHVDN examples:
UI.ShowSubtitle
SHVDN2
GTA.UI.Screen.ShowSubtitle
SHVDN3or somewhat less obvious
vehicle15.InstallModKit becomes vehicle15.Mods.InstallModKit
GetOffsetInWorldCoords has been replaced by GetOffsetPosition
- I'm a big fan and proponent of snippets, but from my own experience (less now than before) it is best to also provide where the snippet goes and what references/assemblies are required. For example, user should know when the snippet goes in ontick, on a key press, or called by another function.
One final note, caution with showing bigmessage with LemonUI as their is considerable and learning "overhead" before using LemonUI. Here I'm speaking from practical experience: my own LemonUI menu is spread over 30 .cs files, with several thousand lines of code. So probably best to do a tutorial on LemonUI as well. I had done one earlier but with version 2 and have since migrated to 3 and the latest version.
-
@Kangouroux6 said in [Tutorial] Help Notification (Key or blips etc.) + 7 Contextual Code Ex./Snippets C# SHVDN3:
To keep the move ON, If people wants in LemonUI we also have LemonUI.Scaleform.BigMessage , To show message like next pict'
Necroing seems coherent given the context
Anyone can tell me how to use BigMessage? either with LemonUI or Native calls or whatever. Been trying for two days and failing consistently.Visual Studio likes this, no complaints(also quite a few variations of it):
var bigMessage = new BigMessage("Message");
But I don't know how to call it to actually appear on screen.
"bigMessage.Draw()" does nothing despite the fact IntelliSense telling me it will draw fullscreen.
-
It actually does appear but get replaced in the next frame. You see this class library was built basically using the GTA.UI api.
For example try using the GTA.UI.TextElement, It will behave the similarly.Try this it will show like you want :
class xyz {
var bigMessage = new BigMessage("Message"); // define this in global scope
func x {
bigMessege.Visible = true; // set this to true
bigMessege.FadeOut(5000); // set a fadeout
}onTick {
// Use either of the following to display
bigMessege.Draw();
bigMessege.DrawFullScreen();
bigMessege.Process();
}
}
-
@Raiyus13 thanks a lot, that got me going
-
@Raiyus13 said in [Tutorial] Help Notification (Key or blips etc.) + 7 Contextual Code Ex./Snippets C# SHVDN3:
bigMessege.Draw();
bigMessege.DrawFullScreen();
bigMessege.Process();Probably better to use bigMessage if you want it recognized, rather than bigMessege
-
@JohnFromGWN now it's faster to declare bigMessege
-
@Sata lol
It was declared as message but used as messege