Hello and welcome to the forum. Considering what you mentioned, I will provide a solution that uses only images and allows you to customize player names with them.
Step 1: Store the actual player name in a variable.
You can do this by using an actual character name and storing it in a variable using the appropriate event command (
Control Variable, then Scirpt, then $game_actors[actor_id_here].name). Just remember to replace
"actor_id_here" with the actual actor ID.
Step 2: Split the name in multiple variables.
Define a batch of variables (e.g. from 1 to 30) and use them to store your actor name characters. You can do it using a simple script call:
Ruby:
$game_actors[actor_id_herre].name.chars.each_with_index do |c, i|
$game_variables[starting_id_of_the_batch + i] = c
end
Step 3: Store the total name length in a variable to avoid unnecessary iterations later.
Of course, you don't want to iterate the whole batch of variables in case the name is shorter than expected. For this reason, store the actual length in a separate variable using the event command (
Control Varlable, ,then Script, then $game_actors[actor_id_here].name.length).
Step 4: Store the starting position for your images in two different variables (one for x, the other for Y).
For this step you need to define a starting position for the name to appear in the HUD. Coordinates for such position must be stored in a variable so that you can use them later.
Step 5: Copy starting coodinates in two separate variables.
This step might seem unnecessary, but it is not, especially if you want to be able to redraw your characters later on. If you do it this way, you can keep the starting position in the original variables and use the new one to place subsequent characters in the name.
Step 6: Select a variable to use as a counter and set it to 0.
Variables are always initialized to 0 in VXAce, but doing this step explicitly ensures that they are exactly zero when you need them.
Step 7: Define the width for each character image.
This is what actually allows you to place all the images in the correct place. To do so, you need to define the width for each character (in pixels) and store it somewhere. Personally, I recommend using a map and store it in a variable using a Script Call command.
Ruby:
$game_variables[variable_id_where_you_store_your_map] = {
'A' => width_of_character_A,
'B' => width_of_character_B,
...
'Z' => width_of_character_Z,
'a' => width_of_character_a,
...
'z' => width_of_character_z
}
You need to replace each "width_of_character_?" with the appropriate character width in pixels basaed on the image you are using.
Step 8: Create a loop to display images.
First of all start a loop. For each iteration of the loop, you have to perform the following steps:
- Get the character that needs to be displayed from the batch of variables used to store the character name. The correct id is the one obtained by adding the counter variable value to the starting id of the batch.
- Decide which image to show using a conditional branch to compare the character obtained in the previous step with all those you can display.
- In the conditional branch, first display the image at the right position, then increase the copied starting point coordinates.
- Display the appropriate image (image id depends on the value of your counter variable) using the copied coordinates as starting points.
- Increase the horizontal coordinate by an amount of pixels equal to
$game_variables[variable_id_where_you_store_your_map][$game_variable[starting_batch_id + $game_variables[counter_variable_id]]]
- Increase the counter variable by 1.
- Check whether the counter variable value is equal to the full name length using a conditional branch.
- If it is, then break the loop.
Done, your name should be now visible using just images.