Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing Single Player textdraws #107

Open
WoutProvost opened this issue Mar 1, 2019 · 1 comment
Open

Add missing Single Player textdraws #107

WoutProvost opened this issue Mar 1, 2019 · 1 comment

Comments

@WoutProvost
Copy link
Contributor

WoutProvost commented Mar 1, 2019

Talked with @Y-Less about this. I'll just copy all of the provided information here. The names could be improved tho, because I don't think these ones convey enough what they are.

Mission Subtitles

SubtitleTD = TextDrawCreate(320.0, 367.5, "_");
TextDrawAlignment(SubtitleTD, 2);
TextDrawLetterSize(SubtitleTD, 0.58, 2.45);
TextDrawTextSize(SubtitleTD, 0.0, 600.0);
  • There is no set time of how long these should stay visible, since you want longer subtitles to display for longer and shorter subtitles to display for shorter. However, you want very short subtitles to display for at least a minimum amount. Anyway, I just default mine to 1500ms, since that seems to be fine for most small dialog.
  • This textdraw is also very often used in conjunction with a sound ID (ask me further if you want an example of this).
  • Line-breaks ~n~ are not needed, since it happens automatically due to the textdraws textsize.

Mission Objectives

ObjectiveTD = TextDrawCreate(379.5, 341.5, "_");
TextDrawAlignment(ObjectiveTD, 2);
TextDrawLetterSize(ObjectiveTD, 0.58, 2.35);
TextDrawTextSize(ObjectiveTD, 0.0, 500.0);
  • Most in-game objectives last for 8000ms, so that's probably a good default.
  • This textdraw is also exclusively used with the YSF provided native TogglePlayerWidescreen.
  • Line-breaks ~n~ are not needed, since it happens automatically due to the textdraws textsize.

Info Box

InfoBoxTD = TextDrawCreate(33.5, 27.5, "_");
TextDrawUseBox(InfoBoxTD, 1);
TextDrawBoxColor(InfoBoxTD, 0x000000c0);
TextDrawSetShadow(InfoBoxTD, 0);
TextDrawLetterSize(InfoBoxTD, 0.52, 2.2);
TextDrawTextSize(InfoBoxTD, 200.0, 0.0);
  • The default width is 200.0, but sometimes 128.0 or 250.0 are used in main.scm. However even those are not always the case (I was testing against a sample in which I needed 230.0), so this is one of those things that users really need to be able to define themselves. 200.0 is a good default tho.
  • Most of the time in-game, the info last for 5000ms, so that's probably a good default.
  • This textdraw is always displayed with an alert sound (I use 1083, which is the closest one to the single player sound. The actual sound is not accessible, since SA-MP can't play sounds from the GTA_SA/audio/SFX/GENRL file).
  • Line-breaks ~n~ are not needed, since it happens automatically due to the textdraws textsize.
  • Due to the SA-MP chat being in the way, it's a good idea to lower the y position of the textdraw from its original position. However, this will never be perfect, due to clients being able to use the /pagesize command. Another alternative is to use a clearchat function in conjunction with this textdraw.
  • I couldn't get the colors quite right due to the transparancy, but I think it's close enough.

In-game Clock

TimeTD = TextDrawCreate(547.8, 22.2, "00:00");
TextDrawFont(TimeTD, 3);
TextDrawSetShadow(TimeTD, 0);
TextDrawSetOutline(TimeTD, 2);
TextDrawSetProportional(TimeTD, 0);
TextDrawLetterSize(TimeTD, 0.55, 2.15);
  • I replicated this one, because all versions I found in other scripts weren't that great.
  • I use it for example to display the actual server time, with the exact look of the in-game clock.

Others

  • Money textdraw?
@WoutProvost
Copy link
Contributor Author

Maybe this is of any use, probably not though. It's a repository that contains reverse engineered code for the GTA:SA executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant