samp.directory
← Skrypty i biblioteki

aujiz11/typing-textdraw

SA-MP/open.mp library creates text typing animation for TextDraw Player

Biblioteka★ 2zaktualizowano sie 2025Brak licencjiPawnsampctl
Otwórz na GitHubie

To repozytorium nie ma pliku licencji. Jest publiczne do odczytu, ale samo to nie daje pozwolenia na ponowne użycie.

Zainstaluj za pomocą sampctl

sampctl package install aujiz11/typing-textdraw

Uruchom to w folderze swojego projektu. sampctl pobiera pakiet i to, od czego zależy.

Wypróbuj w kompilatorze Pawn →

Dodaje jej pliki include, razem z bibliotekami, od których zależy, do kompilatora Pawn w twojej przeglądarce, gotowe do dołączenia w skrypcie.

README.md

typing-textdraw

Installation

Simply install to your project:

sampctl package install aujiz11/typing-textdraw

Include in your code and begin using the library:

#include <typing-textdraw>

Usage

The library provides a simple way to display a typing animation using PlayerTextDraws. To use, call the ShowTypingTextDraw function:

// Show a typing animation for the given player and PlayerText:id
ShowTypingTextDraw(playerid, PlayerText:id, "Your text here");

Parameters for ShowTypingTextDraw:

  • playerid: The player to show the typing animation to.
  • id: The PlayerTextDraw to update.
  • text[]: The text to display with typing effect.
  • interval (optional): Milliseconds between each character (default: TYPING_INTERVAL).

Example:

new PlayerText:myTextDraw = CreatePlayerTextDraw(playerid, ...); // create your PlayerTextDraw
ShowTypingTextDraw(playerid, myTextDraw, "Welcome to the server!");

The typing animation will automatically stop when the text is fully displayed or the player disconnects.

When the typing animation finishes, the following callback is called:

public OnTypingTextDrawFinish(playerid, PlayerText:playertextid)
{
    // Your code here
}
  • playerid: The player whose animation finished.
  • playertextid: The PlayerTextDraw that finished typing.

Use this callback to perform actions after the animation ends (e.g., show another message, hide the textdraw, etc).

Definitions

You can customize the typing effect by defining these macros before including the library:

#define TYPING_MAX_LENGTH  // Maximum length of the text (default: 1028)
#define TYPING_INTERVAL    // Interval in milliseconds between each character (default: 100)

Example:

#define TYPING_MAX_LENGTH 512
#define TYPING_INTERVAL 50
#include <typing-textdraw>

Demo

Testing

To test, simply run the package:

sampctl package run

Ta strona jest zbudowana z tego, co GitHub publikuje o repozytorium. samp.directory nie hostuje kodu. Zgłoś problem z tym wpisem

aujiz11/typing-textdraw: Biblioteka SA-MP | samp.directory