Jump to content

[Tutorial - LUA - 1080p] Custom Font and On Screen Text


Papa Beans
 Share

Recommended Posts

Hello everyone. I really feel like 3.1 is lacking materials / tutorials out there for lua scripting. I do not personally know lua but am starting to learn. Below I show you guys how to display a Custom font and how to display text to the screen. I hope you enjoy!

 

It is in 1080p Youtube just has to render it

 

http://www.youtube.com/watch?v=b4fZx9wQ0jM

P.S. I linked the custom code colors to this thread. Feel free to use them if you like them smile.png

  • Upvote 2
Link to comment
Share on other sites

Nice tutorial man. You could also put that code in the weapon or player script also since then it would have access directly to some ammo variable and know when the gun is fired to reduce ammo, but putting it in a pivot is also a valid option. If you put it in a pivot you'd want to make some kind of output called from the player/weapon script and connect that output with some kind of input to the UI script and hook those up in the flowgraph so your UI script can be informed when the ammo changes.

 

I know this was more about fonts, but just giving you options and things to think about with your next tutorial on ammo/clips.

 

I personally like the separation of scripts between the UI and the player, but it requires a little more hookups via the flowgraph to work. We used to be able to attach multiple scripts to an entity, which I thought was nice, but that was removed so pivots are the next best way to get this kind of separation. If you want to make easy and reusable scripts separating them is the way to go.

  • Upvote 2
Link to comment
Share on other sites

I wouldn't call flowgraphs the "correct" way. It's just one way to do it. The benefits are it helps avoid direct dependencies between scripts. This makes your scripts more component like that people can connect together with the flowgraph. Some people don't care about that and will just make direct dependencies of other scripts. I personally don't like that, but to each their own :)

Link to comment
Share on other sites

Just to make you know it's appreciated that you did that tutorial smile.png Thank you for showing the way. Please continue with those tutorials.

 

If i may suggest: I'm always curious why things are done they way they're done. That's because it's easier for me to understand why something works if i have some explanation for it, so not sure how others see it, but it would be cool if you could explain why smth. does not work with "Setting A" but does with "Setting B" (if you can explain it - i know there are some things that you just "know" but you're not sure "why" smile.png)

  • Upvote 1
Link to comment
Share on other sites

Nice color scheme in the Lua IDE.

Could you add support for changing the background color of the main editor. so that we can make it a dark grey. To fix the icons that are black if the color goes below a certain darkness threshhold you invert the color of the icons. Because it would be nice to work in a darker grey. It looks cooler and when your working in a dark place its not so bright.

Link to comment
Share on other sites

Could you add support for changing the background color of the main editor. so that we can make it a dark grey. To fix the icons that are black if the color goes below a certain darkness threshhold you invert the color of the icons. Because it would be nice to work in a darker grey. It looks cooler and when your working in a dark place its not so bright.

 

I don't think that it is possible to change the color of the main editor, or else I would. You should put this in the recomendations forum!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...