Any good tutorial on how to create custom textures?
#1

Such as phones, a message that fades into the screen with an animation and then fades out, etc.
Reply
#2

With the search button you can find different ways.. Here it is a tutorial
Reply
#3

Thank you! It looks really complicated, once I get the hang of it, will it be easier? I was never good with art but here it's only syntax so it should be better, right?
Reply
#4

Quote:
Originally Posted by EtayJ
Посмотреть сообщение
Thank you! It looks really complicated, once I get the hang of it, will it be easier? I was never good with art but here it's only syntax so it should be better, right?
It's quite simple. He just creates a textdraw which covers the entire screen in OnGameModeInit. With the command (you can put the things present in that command in a function or in a callback or wherever you want) he makes the player see the textdraw which is seen first with full color (0 transparency) and he starts a Timer of 50ms true which reduce the transparency of the textdraw every 50 ms until it goes to "00".

That's all, plus the tutorial use too much variables in my opinion. You can do something like this too:


PHP код:
new fades[15][10] =
{
 {
0x000000EE},
 {
0x000000DD},
 {
0x000000CC},
 {
0x000000BB},
 {
0x000000AA},
 {
0x00000099},
 {
0x00000088},
 {
0x00000077},
 {
0x00000066},
 {
0x00000055},
 {
0x00000044},
 {
0x00000033},
 {
0x00000022},
 {
0x00000011},
 {
0x00000000}
};
CMD:fade(playeridparams[])
{
    if(
FadeTDTimer [playerid] == 0)
    {
        
TextDrawShowForPlayer(playeridWholeScreen);
        
// We obviously have to show the TextDraw we want to fade..
        
FadeTDTimerplayerid ] = 1;
        
Fade(playerid0);
    }
    else return 
SendClientMessageplayerid, -1"You are already fading!" );
    return 
true;
}
forward Fade(playeridtimes);
public 
Fade(playeridtimes)
{
    
TextDrawBoxColor(WholeScreenfades[times][0]);
    switch(
times// This is faster than an 'if statement'
    
{
        case 
.. 12SetTimerEx("Fade"50false"ii"playeridtimes+1);
        case 
13FadeTDTimer[playerid] = SetTimerEx("Fade"50false"ii"playeridtimes+1);
        case 
14:
        {
            
TextDrawBoxColor(WholeScreenfades[times][0]);
            
KillTimer(FadeTDTimer [playerid]);
            
TextDrawHideForPlayerplayeridWholeScreen );
            
// Hide the transparent TextDraw.
            
return true;
        }
    }
    
TextDrawHideForPlayer(playeridWholeScreen);
    
TextDrawShowForPlayer(playeridWholeScreen);
    return 
1;
    
// Every time the function is called, the TextDraw is refreshed (Hidden & then re-shown and their ScreenStatus goes up 1.

I didn't tested. Remember that the Textdraw is global. So it will give you problems if more players in the same amount of time (~750ms) do the command
Reply
#5

Thank you, mind explaining how the function knows to call itself again till it reaches 15? Because I only see a return statement, not a loop or something.
EDIT:
Nevermind, I am stupid, it's the timer doing it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)